Class: SmartCollection::Reflection::SmartCollectionReflection
- Inherits:
-
ActiveRecord::Reflection::HasManyReflection
- Object
- ActiveRecord::Reflection::HasManyReflection
- SmartCollection::Reflection::SmartCollectionReflection
- Defined in:
- lib/smart_collection/reflection/smart_collection_reflection.rb
Instance Method Summary collapse
Instance Method Details
#association_class ⇒ Object
4 5 6 |
# File 'lib/smart_collection/reflection/smart_collection_reflection.rb', line 4 def association_class Associations::SmartCollectionAssociation end |
#chain ⇒ Object
14 15 16 17 |
# File 'lib/smart_collection/reflection/smart_collection_reflection.rb', line 14 def chain items_name = [:smart_collection].items_name active_record.reflect_on_association("cached_#{items_name}".to_sym).chain end |
#check_eager_loadable! ⇒ Object
8 9 10 11 12 |
# File 'lib/smart_collection/reflection/smart_collection_reflection.rb', line 8 def check_eager_loadable! unless [:smart_collection].cache_manager.instance_of? SmartCollection::CacheManager::Table raise RuntimeError, 'eager_load is only supported when using table for cache.' end end |