Sha256: 9cb9de56bfdcf4055e26f9497cab0867678cc65a00734ad828f4c14a79d673d3

Contents?: true

Size: 586 Bytes

Versions: 10

Compression:

Stored size: 586 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 has_picture? -%>
  mount_uploader :picture, PictureUploader

<%- end -%>
  enum status: <%= BootswatchRails::USER_STATUS %>
  validates :status, presence: true

  enum theme: BootswatchRails::THEMES
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bootswatch_rails-3.2.0.22 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.21 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.20 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.19 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.18 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.17 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.16 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.15 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.14 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb
bootswatch_rails-3.2.0.13 lib/generators/bootswatch_rails/sorcery/templates/user_model.rb