Class: Geert::Association
- Inherits:
-
Object
- Object
- Geert::Association
- Defined in:
- lib/geert/association.rb
Instance Method Summary collapse
- #column ⇒ Object
- #exclude? ⇒ Boolean
- #migration ⇒ Object
- #output ⇒ Object
- #polymorphic? ⇒ Boolean
- #target ⇒ Object
Instance Method Details
#column ⇒ Object
18 19 20 |
# File 'lib/geert/association.rb', line 18 def column reflection.primary_key_name end |
#exclude? ⇒ Boolean
26 27 28 |
# File 'lib/geert/association.rb', line 26 def exclude? existing? or polymorphic? or uses_polymorphic? end |
#migration ⇒ Object
6 7 8 |
# File 'lib/geert/association.rb', line 6 def migration ":#{source}, :#{target}#{}" unless exclude? end |
#output ⇒ Object
10 11 12 |
# File 'lib/geert/association.rb', line 10 def output " :" + target + unless exclude? end |
#polymorphic? ⇒ Boolean
14 15 16 |
# File 'lib/geert/association.rb', line 14 def polymorphic? reflection.[:polymorphic] end |
#target ⇒ Object
22 23 24 |
# File 'lib/geert/association.rb', line 22 def target reflection.table_name end |