Sha256: 227d81a775d2539b0dd399a20dcbfb9dcd5c1b1c35f81f75ae244c77a118219f

Contents?: true

Size: 653 Bytes

Versions: 3

Compression:

Stored size: 653 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

<%- if options.authorization? -%>
  has_many :assignments
  has_many :roles, through: :assignments
  has_many :abilities, through: :roles

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bootswatch_rails-3.2.0.42 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.41 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.40 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb