Class: UserPreferences::Preference

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/user_preferences/preference.rb

Instance Method Summary collapse

Instance Method Details

#definitionObject



22
23
24
# File 'lib/user_preferences/preference.rb', line 22

def definition
  UserPreferences[category, name]
end

#update_value!(v) ⇒ Object



10
11
12
# File 'lib/user_preferences/preference.rb', line 10

def update_value!(v)
  update_attributes!(value: v)
end

#valueObject



14
15
16
# File 'lib/user_preferences/preference.rb', line 14

def value
  lookup(attributes['value'])
end

#value=(v) ⇒ Object



18
19
20
# File 'lib/user_preferences/preference.rb', line 18

def value=(v)
  super(to_db(v))
end