Class: ActiveFacts::API::Role

Inherits:
Object
  • Object
show all
Defined in:
lib/activefacts/persistence/object_type.rb

Overview

A one-to-one can be absorbed into either table. We decide which by comparing the names, just as happens in ObjectType.populate_reference (see reference.rb)

Instance Method Summary collapse

Instance Method Details

#counterpart_unary_has_precedenceObject



173
174
175
176
177
# File 'lib/activefacts/persistence/object_type.rb', line 173

def counterpart_unary_has_precedence
  counterpart_object_type.is_table_subtype and
    counterpart.unique and
    owner.name.downcase < counterpart.owner.name.downcase
end