Sha256: 2e311220329309f63d229eac7f1eecd14668ae583586721c9bb80b2d972e9842

Contents?: true

Size: 598 Bytes

Versions: 7

Compression:

Stored size: 598 Bytes

Contents

case DOORKEEPER_ORM
when :active_record
  class User < ActiveRecord::Base
  end
when :mongoid2, :mongoid3, :mongoid4
  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
    attr_accessible :name, :password
  end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
doorkeeper-1.4.2 spec/dummy/app/models/user.rb
doorkeeper-1.4.1 spec/dummy/app/models/user.rb
doorkeeper-2.0.0.alpha1 spec/dummy/app/models/user.rb
doorkeeper-1.4.0 spec/dummy/app/models/user.rb
doorkeeper-1.3.1 spec/dummy/app/models/user.rb
doorkeeper-1.3.0 spec/dummy/app/models/user.rb
doorkeeper-1.2.0 spec/dummy/app/models/user.rb