Methods
Class Public methods
add(id, hash_attributes)
Link
Source: show
# 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()
Link
Source: show
# File app/models/cardboard/setting.rb, line 21 def clear_saved_settings @lock.synchronize do @_settings = nil end end
method_missing(sym, *args, &block)
Link
Source: show
# 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