Module: Impressionist::Impressionable::ClassMethods
- Defined in:
- app/models/impressionist/impressionable.rb,
lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb
Instance Attribute Summary collapse
-
#impressionist_cache_options ⇒ Object
Returns the value of attribute impressionist_cache_options.
Instance Method Summary collapse
- #counter_caching? ⇒ Boolean
- #impressionist_counter_cache_options ⇒ Object
-
#impressionist_counter_caching? ⇒ Boolean
asks impressionable entity whether or not it is counter_caching.
- #is_impressionable(options = {}) ⇒ Object
Instance Attribute Details
#impressionist_cache_options ⇒ Object
Returns the value of attribute impressionist_cache_options.
6 7 8 |
# File 'app/models/impressionist/impressionable.rb', line 6 def @impressionist_cache_options end |
Instance Method Details
#counter_caching? ⇒ Boolean
24 25 26 27 |
# File 'app/models/impressionist/impressionable.rb', line 24 def counter_caching? ::ActiveSupport::Deprecation.warn("#counter_caching? is deprecated; please use #impressionist_counter_caching? instead") impressionist_counter_caching? end |
#impressionist_counter_cache_options ⇒ Object
14 15 16 17 |
# File 'app/models/impressionist/impressionable.rb', line 14 def @impressionist_cache_options ||= {} @impressionist_cache_options.reverse_merge!(DEFAULT_CACHE) end |
#impressionist_counter_caching? ⇒ Boolean
asks impressionable entity whether or not it is counter_caching
20 21 22 |
# File 'app/models/impressionist/impressionable.rb', line 20 def impressionist_counter_caching? [:counter_cache] end |
#is_impressionable(options = {}) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb', line 9 def is_impressionable(={}) many(:impressions, :as => :impressionable, :dependent => :destroy) @impressionist_cache_options = end |