Created
July 19, 2013 18:59
-
-
Save jessenaiman/6041515 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Riding < ActiveRecord::Base | |
attr_accessible :poll_stations | |
#has_many :poll_street_indices | |
has_many :poll_stations | |
end | |
####################################################### | |
class PollStation < ActiveRecord::Base | |
attr_accessible :electoral_district, :poll_division, :location, :address1, :address2, :place | |
belongs_to :riding | |
end | |
####################################################### | |
class CreatePollStations < ActiveRecord::Migration | |
def self.up | |
create_table :poll_stations do |t| | |
t.integer :electoral_district | |
t.integer :poll_division | |
t.string :location | |
t.string :address1 | |
t.string :address2 | |
t.string :place | |
t.references :riding | |
t.timestamps | |
end | |
end | |
def self.down | |
drop_table :poll_stations | |
end | |
end | |
######################################## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment