Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class LegacyBase < ActiveRecord::Base
- establish_connection(
- :adapter => "mysql",
- :host => "localhost",
- :username => "",
- :password => "",
- :database => "ws_prosecutions"
- )
- end
- class LegacyProsecutions < LegacyBase
- set_table_name "prosecutions"
- def migrate_me!
- prosecution = Prosecution.create(
- :defendant => self.Defendant,
- :section => (self.Section || '') + " -- " + (self.zSearch_sec_reg_1 || '') + " - " + (self.zSearch_sec_reg_2 || '') + " - " + (self.zSearch_sec_reg_3 || ''),
- :description => self.Description,
- :background => self.Background,
- :conviction_date => (self.Conviction\ Date || '').to_date,
- :court => self.Court,
- :fine => self.Fine,
- :outcome_summary => self.Outcome\ Summary,
- :charge_number => self.Charge_Number || '',
- :date_added => (self.Date\ Added || '').to_date,
- :regulation => self.Regulation || '',
- :offence_date => self.Offence_Date,
- :trading_name => self.Trading_Name || '',
- :inspector => self.Inspector,
- :costs => self.Costs || '',
- :file_number => self.File_Number,
- :publish => self.Publish.downcase == "yes" ? true : false,
- :image => self.Image || ''
- )
- end
- end
Add Comment
Please, Sign In to add comment