jam-cloud/admin/config/initializers/jam_ruby_user.rb

42 lines
905 B
Ruby

class JamRuby::User
attr_accessible :admin, :raw_password, :musician, :can_invite, :photo_url, :session_settings, :confirm_url, :teacher_attributes, :email_template # :invite_email
accepts_nested_attributes_for :teacher, allow_destroy: true
def raw_password
''
end
def raw_password= pw
unless pw.blank?
# change_password(pw, pw)
self.updating_password = true
self.password = pw
self.password_confirmation = pw
if au = self.admin_user
au.update_attribute(:encrypted_password, self.password_digest)
end
end
end
def admin_user
User.where(:email => self.email)[0]
end
def show_frame_options
self.get_gear_mod(MOD_GEAR_FRAME_OPTIONS)
end
def how_to_use_video_no_show
self.get_no_show_mod(HOWTO_USE_VIDEO_NOSHOW)
end
def configure_video_no_show
self.get_no_show_mod(CONFIGURE_VIDEO_NOSHOW)
end
end