Module: ScopedAssociations::ActiveRecord4::HasOne::ReflectionExtension
- Defined in:
- lib/scoped_associations/activerecord4/has_one.rb
Instance Method Summary collapse
Instance Method Details
#association_class ⇒ Object
60 61 62 |
# File 'lib/scoped_associations/activerecord4/has_one.rb', line 60 def association_class ScopedHasOneAssociation end |
#foreign_scope ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/scoped_associations/activerecord4/has_one.rb', line 51 def foreign_scope if [:as] "#{[:as]}_scope" else name = active_record.name name.demodulize.underscore + "_scope" end end |