Sha256: 2b8cffe67a43969beba6d8e094cce628af730c4610f7a99238cd143c062812ce

Contents?: true

Size: 726 Bytes

Versions: 10

Compression:

Stored size: 726 Bytes

Contents

class <%= class_name %> < ActiveRecord::Base
  authenticates_with_sorcery!
  validates :email, presence: true, uniqueness: { case_sensitive: false }
  validates :password, presence: true, on: :create
  validates :password, length: { minimum: 6 }, unless: Proc.new { |a| a.password.blank? }
  validates :password, confirmation: true
  validates :password_confirmation, presence: true, on: :create
<%- if options.authority? -%>
  include Authority::UserAbilities
<%- end -%>

  default_scope { order(:name) }
  scope :active,  -> { where(active: true) }
  scope :sysadms, -> { where(sysadm: true) }
  
<%- if options.picture? -%>
  mount_uploader :picture, PictureUploader

<%- end -%>
  enum theme: BootswatchRails::THEMES
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bootswatch_rails-3.3.7.1 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.3.7.0 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.3.6.2 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.3.6.1 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.3.5.2 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.3.5.1 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.3.4.1 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.3.2.1 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.3.1.2 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.3.1.1 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb