Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/ca_ching/adapters/active_record.rb
Instance Attribute Summary collapse
-
#from_cache ⇒ Object
Returns the value of attribute from_cache.
Instance Method Summary collapse
Instance Attribute Details
#from_cache ⇒ Object
Returns the value of attribute from_cache.
7 8 9 |
# File 'lib/ca_ching/adapters/active_record.rb', line 7 def from_cache @from_cache end |
Instance Method Details
#from_cache? ⇒ Boolean
9 10 11 |
# File 'lib/ca_ching/adapters/active_record.rb', line 9 def from_cache? @from_cache ||= false end |
#to_keys(options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ca_ching/adapters/active_record.rb', line 13 def to_keys(={}) was = [:old_values] ? "_was" : "" indexed_fields.map do |index, | if index.is_a?(Array) self.class.table_name.to_s + index.map { |index| "#{index}=#{self.send("#{index}#{was}")}" }.join("&") else "#{self.class.table_name}:#{index}=#{self.send("#{index}#{was}")}" end end end |