Class: IdentityCache::Cached::AttributeByMulti
- Defined in:
- lib/identity_cache/cached/attribute_by_multi.rb
Instance Attribute Summary
Attributes inherited from Attribute
#alias_name, #key_fields, #model, #unique
Instance Method Summary collapse
Methods inherited from Attribute
#attribute, #cache_key, #expire, #fetch, #initialize, #load_one_from_db
Constructor Details
This class inherits a constructor from IdentityCache::Cached::Attribute
Instance Method Details
#build ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/identity_cache/cached/attribute_by_multi.rb', line 6 def build cached_attribute = self model.define_singleton_method(:"fetch_#{fetch_method_suffix}") do |*key_values| raise_if_scoped cached_attribute.fetch(key_values) end end |