Sha256: 3b4164332d6622e85a42fd8c3cf15e413b6524e497a5b6b7eb65713a0f4909b5

Contents?: true

Size: 670 Bytes

Versions: 1

Compression:

Stored size: 670 Bytes

Contents

case DOORKEEPER_ORM.to_s
when "active_record"
  class User < ActiveRecord::Base
  end
when /mongoid/
  class User
    include Mongoid::Document
    include Mongoid::Timestamps

    field :name, type: String
    field :password, type: String
  end
when "mongo_mapper"
  class User
    include MongoMapper::Document
    timestamps!

    key :name,     String
    key :password, String
  end
end

class User
  include ActiveModel::MassAssignmentSecurity if defined?(::ProtectedAttributes)

  if respond_to?(:attr_accessible)
    attr_accessible :name, :password
  end

  def self.authenticate!(name, password)
    User.where(name: name, password: password).first
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
doorkeeper-2.2.2 spec/dummy/app/models/user.rb