Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
111 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule doorkeeper
updated
18 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
case DOORKEEPER_ORM.to_s | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
defaults: &defaults | ||
host: 127.0.0.1 | ||
port: 27017 | ||
|
||
development: | ||
<<: *defaults | ||
database: doorkeeper-mongomapper-development | ||
|
||
test: | ||
<<: *defaults | ||
database: doorkeeper-mongomapper-test-suite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
development: | ||
database: doorkeeper-development | ||
persist_in_safe_mode: true | ||
autocreate_indexes: true | ||
|
||
test: | ||
database: doorkeeper-mongoid2-test | ||
persist_in_safe_mode: true | ||
autocreate_indexes: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
development: | ||
sessions: | ||
default: | ||
database: doorkeeper-mongoid3-development | ||
hosts: | ||
- localhost:27017 | ||
options: | ||
consistency: :strong | ||
safe: true | ||
test: | ||
sessions: | ||
default: | ||
database: doorkeeper-mongoid3-test | ||
hosts: | ||
- localhost:27017 | ||
options: | ||
consistency: :strong | ||
safe: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
development: | ||
sessions: | ||
default: | ||
database: doorkeeper-mongoid4-development | ||
hosts: | ||
- localhost:27017 | ||
options: | ||
write: | ||
w: 1 | ||
|
||
test: | ||
sessions: | ||
default: | ||
database: doorkeeper-mongoid4-test | ||
hosts: | ||
- localhost:27017 | ||
options: | ||
write: | ||
w: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
DatabaseCleaner[:mongo_mapper].strategy = :truncation | ||
DatabaseCleaner[:mongo_mapper].clean_with :truncation | ||
|
||
RSpec.configure do |config| | ||
config.before :suite do | ||
Doorkeeper::Application.create_indexes | ||
Doorkeeper::AccessGrant.create_indexes | ||
Doorkeeper::AccessToken.create_indexes | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
DatabaseCleaner[:mongoid].strategy = :truncation | ||
DatabaseCleaner[:mongoid].clean_with :truncation | ||
|
||
RSpec.configure do |config| | ||
config.before do | ||
Doorkeeper::Application.create_indexes | ||
Doorkeeper::AccessGrant.create_indexes | ||
Doorkeeper::AccessToken.create_indexes | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require_relative "mongoid.rb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require_relative "mongoid.rb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require_relative "mongoid.rb" |