doorkeeper 2.0.0.rc3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb6985f71c5db8c5a96f9205a290aa6d36956177
|
|
4
|
+
data.tar.gz: 4d96f1493d890735bdeaf379c6345a949ecd0857
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0efb46569e591675b5a208a7cae0d72eb746a17ea99573359e7788374afdcc9b052ef38577abba6681aecb89ddc95e7d6dc0b09bb7201beeb2ac0c4f671d899f
|
|
7
|
+
data.tar.gz: c3786d7fb5f6c2867fddd0d67948bfdc0292451f82aec9fcb1075b08d37c1a439028984c11e2100f1a2cff7ddd8e223e0da8dfb11ae511085bec9fa9b5c1486a
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<% end %>
|
|
5
5
|
|
|
6
6
|
<%= content_tag :div, class: "form-group#{' has-error' if application.errors[:name].present?}" do %>
|
|
7
|
-
<%= f.label :name, class: 'col-sm-2 control-label'
|
|
7
|
+
<%= f.label :name, class: 'col-sm-2 control-label' %>
|
|
8
8
|
<div class="col-sm-10">
|
|
9
9
|
<%= f.text_field :name, class: 'form-control' %>
|
|
10
10
|
<%= doorkeeper_errors_for application, :name %>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<% end %>
|
|
13
13
|
|
|
14
14
|
<%= content_tag :div, class: "form-group#{' has-error' if application.errors[:redirect_uri].present?}" do %>
|
|
15
|
-
<%= f.label :redirect_uri, class: 'col-sm-2 control-label'
|
|
15
|
+
<%= f.label :redirect_uri, class: 'col-sm-2 control-label' %>
|
|
16
16
|
<div class="col-sm-10">
|
|
17
17
|
<%= f.text_area :redirect_uri, class: 'form-control' %>
|
|
18
18
|
<%= doorkeeper_errors_for application, :redirect_uri %>
|
data/lib/doorkeeper/config.rb
CHANGED
|
@@ -8,6 +8,7 @@ module Doorkeeper
|
|
|
8
8
|
def self.configure(&block)
|
|
9
9
|
@config = Config::Builder.new(&block).build
|
|
10
10
|
enable_orm
|
|
11
|
+
check_for_missing_columns
|
|
11
12
|
setup_application_owner if @config.enable_application_owner?
|
|
12
13
|
end
|
|
13
14
|
|
|
@@ -15,6 +16,20 @@ module Doorkeeper
|
|
|
15
16
|
@config || (fail MissingConfiguration.new)
|
|
16
17
|
end
|
|
17
18
|
|
|
19
|
+
def self.check_for_missing_columns
|
|
20
|
+
if Doorkeeper.configuration.orm == :active_record &&
|
|
21
|
+
!Application.new.attributes.include?("scopes")
|
|
22
|
+
|
|
23
|
+
puts <<-MSG.squish
|
|
24
|
+
[doorkeeper] Missing column: `applications.scopes`.
|
|
25
|
+
If you are using ActiveRecord run `rails generate doorkeeper:application_scopes
|
|
26
|
+
&& rake db:migrate` to add it.
|
|
27
|
+
MSG
|
|
28
|
+
end
|
|
29
|
+
rescue ActiveRecord::StatementInvalid
|
|
30
|
+
# trap error when DB is not yet setup
|
|
31
|
+
end
|
|
32
|
+
|
|
18
33
|
def self.enable_orm
|
|
19
34
|
class_name = "doorkeeper/orm/#{configuration.orm}".classify
|
|
20
35
|
class_name.constantize.initialize_models!
|
|
@@ -208,10 +223,6 @@ and that your `initialize_models!` method doesn't raise any errors.\n
|
|
|
208
223
|
@scopes ||= default_scopes + optional_scopes
|
|
209
224
|
end
|
|
210
225
|
|
|
211
|
-
def orm_name
|
|
212
|
-
[:mongoid2, :mongoid3, :mongoid4].include?(orm.to_sym) ? :mongoid : orm
|
|
213
|
-
end
|
|
214
|
-
|
|
215
226
|
def client_credentials_methods
|
|
216
227
|
@client_credentials ||= [:from_basic, :from_params]
|
|
217
228
|
end
|
data/lib/doorkeeper/version.rb
CHANGED
|
@@ -3,7 +3,7 @@ TABLE_NAME_PREFIX = ENV['table_name_prefix'] || nil
|
|
|
3
3
|
TABLE_NAME_SUFFIX = ENV['table_name_suffix'] || nil
|
|
4
4
|
|
|
5
5
|
orm = ENV['BUNDLE_GEMFILE'].match(/Gemfile\.(.+)\.rb/)
|
|
6
|
-
DOORKEEPER_ORM = (orm && orm[1]
|
|
6
|
+
DOORKEEPER_ORM = (orm && orm[1] || :active_record).to_sym
|
|
7
7
|
|
|
8
8
|
$LOAD_PATH.unshift File.dirname(__FILE__)
|
|
9
9
|
|
|
@@ -24,7 +24,11 @@ end
|
|
|
24
24
|
Rails.logger.info "====> Rails version: #{Rails.version}"
|
|
25
25
|
Rails.logger.info "====> Ruby version: #{RUBY_VERSION}"
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
if [:mongoid2, :mongoid3, :mongoid4].include?(DOORKEEPER_ORM)
|
|
28
|
+
require "support/orm/mongoid"
|
|
29
|
+
else
|
|
30
|
+
require "support/orm/#{DOORKEEPER_ORM}"
|
|
31
|
+
end
|
|
28
32
|
|
|
29
33
|
ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../')
|
|
30
34
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: doorkeeper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.0
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Felipe Elias Philipp
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2014-12-
|
|
12
|
+
date: 2014-12-16 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: railties
|
|
@@ -439,9 +439,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
439
439
|
version: '0'
|
|
440
440
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
441
441
|
requirements:
|
|
442
|
-
- - "
|
|
442
|
+
- - ">="
|
|
443
443
|
- !ruby/object:Gem::Version
|
|
444
|
-
version:
|
|
444
|
+
version: '0'
|
|
445
445
|
requirements: []
|
|
446
446
|
rubyforge_project:
|
|
447
447
|
rubygems_version: 2.2.2
|