Methods
A
C
M
Class Public methods
add(id, hash_attributes)
# File app/models/cardboard/setting.rb, line 16
def add(id, hash_attributes)
  field = self.first.fields.where(identifier: id).first_or_initialize
  field.update_attributes!(hash_attributes, :without_protection => true)
end
clear_saved_settings()
# File app/models/cardboard/setting.rb, line 21
def clear_saved_settings
  @lock.synchronize do
    @_settings = nil
  end
end
method_missing(sym, *args, &block)
# File app/models/cardboard/setting.rb, line 27
def method_missing(sym, *args, &block)
  begin
    super
  rescue
    @lock.synchronize do
      @_settings ||= {}
      @_settings[sym.to_sym] ||= begin
        return nil unless self.first
        s = self.first.fields.where(identifier: sym).first
        raise ::ActiveRecord::NoMethodError if s.nil?
        s.value
      end
    end
  end
end