Method: NoBrainer::Document::Association::HasMany::Metadata#foreign_key
- Defined in:
- lib/no_brainer/document/association/has_many.rb
#foreign_key ⇒ Object
10 11 12 13 14 15 |
# File 'lib/no_brainer/document/association/has_many.rb', line 10 def foreign_key return [:foreign_key].try(:to_sym) if .key?(:foreign_key) return :"#{[:as]}_#{primary_key}" if [:as] :"#{owner_model.name.split('::').last.underscore}_#{primary_key}" end |