Sha256: 22b7076762c626c5f203b81c9d42d4bf80a8a367b331f37e06624d5839b93dd2

Contents?: true

Size: 618 Bytes

Versions: 11

Compression:

Stored size: 618 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
  if ::Rails.version.to_i < 4 || defined?(::ProtectedAttributes)
    attr_accessible :name, :password
  end

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
doorkeeper-2.2.1 spec/dummy/app/models/user.rb
doorkeeper-2.2.0 spec/dummy/app/models/user.rb
doorkeeper-2.1.4 spec/dummy/app/models/user.rb
doorkeeper-2.1.3 spec/dummy/app/models/user.rb
doorkeeper-2.1.2 spec/dummy/app/models/user.rb
doorkeeper-2.1.1 spec/dummy/app/models/user.rb
doorkeeper-2.1.0 spec/dummy/app/models/user.rb
doorkeeper-2.0.1 spec/dummy/app/models/user.rb
doorkeeper-2.0.0 spec/dummy/app/models/user.rb
doorkeeper-2.0.0.rc3 spec/dummy/app/models/user.rb
doorkeeper-2.0.0.rc2 spec/dummy/app/models/user.rb