Sha256: 03508377672776bffd42abf9a8949dc409b9c946cd7342175ef824116ff36101

Contents?: true

Size: 607 Bytes

Versions: 6

Compression:

Stored size: 607 Bytes

Contents

class <%= class_name %> < ActiveRecord::Base
  authenticates_with_sorcery!
  validates :email, presence: true, uniqueness: true
  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

  has_many :assignments
  has_many :roles, through: :assignments
  has_many :abilities, through: :roles

<%- if options.picture? -%>
  mount_uploader :picture, PictureUploader

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bootswatch_rails-3.2.0.39 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.38 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.37 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.36 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.35 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.34 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb