in the migration script add state to the Contact

This commit is contained in:
Vladimir Krylov 2015-10-29 15:22:03 +02:00
parent 736aff0fc8
commit d2b5266887
3 changed files with 33 additions and 30 deletions

View file

@ -3,6 +3,7 @@ module Legacy
self.table_name = :contact
belongs_to :object_registry, foreign_key: :id
belongs_to :object, foreign_key: :id
belongs_to :object_state, foreign_key: :id, primary_key: :object_id
has_one :object_state, -> { where('valid_to IS NULL') }, foreign_key: :object_id
end
end