Class: ActiveFacts::RMap::ForeignKey
- Inherits:
-
Object
- Object
- ActiveFacts::RMap::ForeignKey
- Includes:
- Generate::Rails::Helpers
- Defined in:
- lib/activefacts/generators/traits/rails.rb,
lib/activefacts/generators/helpers/rails.rb
Instance Method Summary collapse
Instance Method Details
#rails_from_association_name ⇒ Object
102 103 104 |
# File 'lib/activefacts/generators/traits/rails.rb', line 102 def rails_from_association_name RMap::rails_singular_name(to_name.join('_')) end |
#rails_to_association ⇒ Object
106 107 108 109 110 111 112 113 |
# File 'lib/activefacts/generators/traits/rails.rb', line 106 def rails_to_association jump = jump_reference if jump.is_one_to_one [ "has_one", RMap::rails_singular_name(from_name)] else [ "has_many", RMap::rails_plural_name(from_name)] end end |