Loos
10 years ago
8 changed files with 23 additions and 10 deletions
@ -1,2 +1,3 @@ |
|||
class Agency < ActiveRecord::Base |
|||
has_many :clients |
|||
end |
|||
|
@ -1,3 +1,4 @@ |
|||
class Client < ActiveRecord::Base |
|||
has_one :bike |
|||
belongs_to :agency |
|||
end |
|||
|
@ -0,0 +1,5 @@ |
|||
class AddAgencyToClient < ActiveRecord::Migration |
|||
def change |
|||
add_reference :clients, :agency, index: true |
|||
end |
|||
end |
@ -0,0 +1,5 @@ |
|||
class RemoveAgencyStringFromClient < ActiveRecord::Migration |
|||
def change |
|||
remove_column :clients, :agency |
|||
end |
|||
end |
Loading…
Reference in new issue