Sha256: 0cb0eb29ad777dcebdbca5c83c92fd00af0246c85bc7067b193392bac55dc730

Contents?: true

Size: 599 Bytes

Versions: 7

Compression:

Stored size: 599 Bytes

Contents

case DOORKEEPER_ORM
when :active_record
  class User < ActiveRecord::Base
  end
when :mongoid2, :mongoid3
  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.0.0 spec/dummy/app/models/user.rb
doorkeeper-1.0.0.rc2 spec/dummy/app/models/user.rb
doorkeeper-1.0.0.rc1 spec/dummy/app/models/user.rb
doorkeeper-0.7.4 spec/dummy/app/models/user.rb
doorkeeper-0.7.3 spec/dummy/app/models/user.rb
doorkeeper-0.7.2 spec/dummy/app/models/user.rb
doorkeeper-0.7.1 spec/dummy/app/models/user.rb