Sha256: 0d436190ea81d2eace2913dfd32f49ddccb97a793a014783d8a202f7f803cb24
Contents?: true
Size: 815 Bytes
Versions: 18
Compression:
Stored size: 815 Bytes
Contents
class AppContainer < ActiveRecord::Base attr_protected :created_at, :updated_at has_user_preferences belongs_to :user belongs_to :app_container_record, :polymorphic => true has_and_belongs_to_many :applications def preferences self.user_preferences.includes([:preference]).where('user_id = ?', self.user.id).map(&:preference) end def get_preference(preference_type_iid) get_user_preference(self.user, preference_type_iid) end def set_preference(preference_type_iid, preference_option_iid) set_user_preference(self.user, preference_type_iid, preference_option_iid) end def setup_default_preferences #template method end class << self def find_by_user(user) AppContainer.where('user_id = ?', user.id).first end end end
Version data entries
18 entries across 18 versions & 1 rubygems