Sha256: 2abe79d39efa622c25bae9b56b9a073b24247ea247a1c1b836fb9fd0b717e5a1

Contents?: true

Size: 527 Bytes

Versions: 9

Compression:

Stored size: 527 Bytes

Contents

require 'type_cartographer'

module People
  class User < ActiveRecord::Base

  	has_many :tokens, :as => :imageable, :class_name => "::Arcadex::Token"

  	has_secure_password

  	after_create :setup_user

    validates :username, presence: true
    #validates_format_of :username, :with => /\A[A-Za-z0-9\d]+\Z/i
    validates :email, presence: true
    #Might need a regex for emails, or just rather confirm them

    def setup_user
    	create_token
    end

    def create_token
      self.tokens.create!
    end

  end
end

Version data entries

9 entries across 7 versions & 1 rubygems

Version Path
json_voorhees-0.2.3 test/test_app/engines/people/app/models/people/user.rb
json_voorhees-0.2.2 test/test_app/engines/people/app/models/people/user.rb
json_voorhees-0.2.1 test/test_app/engines/people/app/models/people/user.rb
json_voorhees-0.2.0 lib/generators/json_voorhees/setup_app/templates/user/user_model.rb
json_voorhees-0.2.0 test/test_app/engines/people/app/models/people/user.rb
json_voorhees-0.1.0 test/test_app/engines/people/app/models/people/user.rb
json_voorhees-0.1.0 lib/generators/json_voorhees/setup_app/templates/user/user_model.rb
json_voorhees-0.0.2 lib/generators/json_voorhees/setup_app/templates/user/user_model.rb
json_voorhees-0.0.1 lib/generators/json_voorhees/setup_app/templates/user/user_model.rb