Files

Class/Module Index [+]

Quicksearch

ActiveRecord::Store::ClassMethods

Public Instance Methods

store(store_attribute, options = {}) click to toggle source
# File lib/active_record/store.rb, line 31
def store(store_attribute, options = {})
  serialize store_attribute, Hash
  store_accessor(store_attribute, options[:accessors]) if options.has_key? :accessors
end
store_accessor(store_attribute, *keys) click to toggle source
# File lib/active_record/store.rb, line 36
def store_accessor(store_attribute, *keys)
  Array(keys).flatten.each do |key|
    define_method("#{key}=") do |value|
      send(store_attribute)[key] = value
      send("#{store_attribute}_will_change!")
    end
    
    define_method(key) do
      send(store_attribute)[key]
    end
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.