spec/fixtures/models.rb in dbee-1.0.1 vs spec/fixtures/models.rb in dbee-1.0.2

- old
+ new

@@ -13,11 +13,11 @@ class PhoneNumbers < Dbee::Base end class Demographics < Dbee::Base - association :phone_numbers, model: PhoneNumbers, + association :phone_numbers, model: 'Models::PhoneNumbers', constraints: { name: :demographic_id, parent: :id } end @@ -54,11 +54,11 @@ ] end class Theaters < TheatersBase association :parent_theater, model: self, constraints: [ - { type: :reference, name: :parent_theater_id, parent: :id } + { type: :reference, name: :id, parent: :parent_theater_id } ] end class A < Dbee::Base table 'table_set_to_a' @@ -111,7 +111,31 @@ class Practices < Dbee::Base association :patients, model: Patients, constraints: { type: :reference, name: :practice_id, parent: :id } + end +end + +module Cycles + class BaseA < Dbee::Base + association :b1, model: 'Cycles::B' + end + + class A < BaseA + association :b2, model: 'Cycles::B' + end + + class B < Dbee::Base + association :c, model: 'Cycles::C' + + association :d, model: 'Cycles::D' + end + + class C < Dbee::Base + association :a, model: 'Cycles::A' + end + + class D < Dbee::Base + association :a, model: 'Cycles::A' end end