Module: ROM::Plugins::Relation::KeyInference
- Defined in:
- lib/rom/plugins/relation/key_inference.rb
Instance Method Summary collapse
-
#base_name ⇒ Symbol
private
Return base name which defaults to name attribute.
-
#foreign_key ⇒ Symbol
private
Infer foreign_key name for this relation.
Instance Method Details
#base_name ⇒ Symbol
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return base name which defaults to name attribute
21 22 23 |
# File 'lib/rom/plugins/relation/key_inference.rb', line 21 def base_name name end |
#foreign_key ⇒ Symbol
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Infer foreign_key name for this relation
TODO: this should be configurable and handled by an injected policy
12 13 14 |
# File 'lib/rom/plugins/relation/key_inference.rb', line 12 def foreign_key :"#{Inflector.singularize(name)}_id" end |