Sha256: a70b25ac7e3022a3ef672d95befc3f29ca5ab410c6106c2772db29a95c06ce22

Contents?: true

Size: 916 Bytes

Versions: 7

Compression:

Stored size: 916 Bytes

Contents

class User < ActiveRecord::Base
  devise :database_authenticatable, :confirmable, :lockable, #:timeoutable,
         :recoverable, :rememberable, :trackable, :validatable, :registerable,
         :encryptable, :encryptor => :sha512

  attr_accessible :password, :password_confirmation, :email, :remember_me,
                  :login, :first_name, :last_name, :patronymic, :phone, :skype, :web_site, :address, :birthday,
                  :time_zone, :locale, :bg_color, :gender


  attr_accessible :user_role_id, :trust_state, :as => :admin

  include AbAdmin::Concerns::AdminAddition
  include AbAdmin::Models::User

  fileuploads :avatar

  def init
    set_default_role
    self.trust_state ||= ::UserState.pending.id
    self.locale ||= 'ru'
    self.time_zone ||= 'Kiev'
  end

  def password_required?
    return true if password.present?
    return false if persisted? && password.blank?
    super
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ab_admin-0.2.3 lib/generators/ab_admin/install/templates/models/user.rb
ab_admin-0.2.2 lib/generators/ab_admin/install/templates/models/user.rb
ab_admin-0.2.1 lib/generators/ab_admin/install/templates/models/user.rb
ab_admin-0.2.0 lib/generators/ab_admin/install/templates/models/user.rb
ab_admin-0.1.2 lib/generators/ab_admin/install/templates/models/user.rb
ab_admin-0.1.1 lib/generators/ab_admin/install/templates/models/user.rb
ab_admin-0.1.0 lib/generators/ab_admin/install/templates/models/user.rb