doorkeeper 4.0.0.rc1 → 4.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of doorkeeper might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1938eaf21efdea722af36789d561f304efeff2b
4
- data.tar.gz: fe6f991a4629c210d625f525908d5f404add55b9
3
+ metadata.gz: cf9f87edf2bb97b62628659cd77adbf6b8efb103
4
+ data.tar.gz: d5481740fd13dc62cc157deb6cb2c75890612e82
5
5
  SHA512:
6
- metadata.gz: 5f61954327e10dffc33b76e8bffed89df45f8bf54bbf127ca0ccac328a63749f09853b40647ff2d848190434a102d2eeac3a582d2056f4ed99f05084d78a8402
7
- data.tar.gz: 9204913127b42e8f7fc8dcc9c351145ad5fb9e04ec2b9e07398eeec96631cef127fcbbd4102fdb4b90f73fc76a3337df57f5f4ce5f110ef3b0dd00e89c0d5bd7
6
+ metadata.gz: daac8f9ffc3dc10f4a3a7f5836641958b5a079569e09e7a623f1119169e93cef1db5f534d9dfbfa1bf355728f9e119158d10de215a0cc45f9eaa19e435df9d91
7
+ data.tar.gz: 66b9b8c90fe75e89d6831f034bfb580ca6d1a2f20157de569bdb67168e15f1e5f9c0b1b26b6b37cc6d11e550deb3b7da621d62a3411a6292f5973d333d328dfa
@@ -4,16 +4,17 @@ sudo: false
4
4
 
5
5
  rvm:
6
6
  - 2.1
7
- - 2.2.2
7
+ - 2.2.4
8
+ - 2.3.0
8
9
  - jruby-head
9
10
 
10
11
  env:
11
12
  - rails=4.2.0
12
- - rails=5.0.0.beta1
13
+ - rails=5.0.0.beta3
13
14
 
14
15
  matrix:
15
16
  exclude:
16
- - env: rails=5.0.0.beta1
17
+ - env: rails=5.0.0.beta3
17
18
  rvm: 2.1
18
- - env: rails=5.0.0.beta1
19
+ - env: rails=5.0.0.beta3
19
20
  rvm: jruby-head
data/NEWS.md CHANGED
@@ -4,6 +4,10 @@ User-visible changes worth mentioning.
4
4
 
5
5
  ---
6
6
 
7
+ ## 4.0.0.rc2
8
+
9
+ - Fix optional belongs_to for Rails 5
10
+
7
11
  ## 4.0.0.rc1
8
12
 
9
13
  ### Backward incompatible changes
@@ -10,7 +10,15 @@ module Doorkeeper
10
10
  include ActiveModel::MassAssignmentSecurity if defined?(::ProtectedAttributes)
11
11
 
12
12
  included do
13
- belongs_to :application, class_name: 'Doorkeeper::Application', inverse_of: :access_grants
13
+ belongs_to_options = {
14
+ class_name: 'Doorkeeper::Application',
15
+ inverse_of: :access_grants
16
+ }
17
+ if defined?(ActiveRecord::Base) && ActiveRecord::VERSION::MAJOR >= 5
18
+ belongs_to_options.merge!(optional: true)
19
+ end
20
+
21
+ belongs_to :application, belongs_to_options
14
22
 
15
23
  if respond_to?(:attr_accessible)
16
24
  attr_accessible :resource_owner_id, :application_id, :expires_in, :redirect_uri, :scopes
@@ -15,7 +15,7 @@ module Doorkeeper
15
15
  inverse_of: :access_tokens
16
16
  }
17
17
  if defined?(ActiveRecord::Base) && ActiveRecord::VERSION::MAJOR >= 5
18
- belongs_to_options.merge(optional: true)
18
+ belongs_to_options.merge!(optional: true)
19
19
  end
20
20
 
21
21
  belongs_to :application, belongs_to_options
@@ -4,7 +4,12 @@ module Doorkeeper
4
4
  extend ActiveSupport::Concern
5
5
 
6
6
  included do
7
- belongs_to :owner, polymorphic: true
7
+ belongs_to_options = { polymorphic: true }
8
+ if defined?(ActiveRecord::Base) && ActiveRecord::VERSION::MAJOR >= 5
9
+ belongs_to_options.merge!(optional: true)
10
+ end
11
+
12
+ belongs_to :owner, belongs_to_options
8
13
  validates :owner, presence: true, if: :validate_owner?
9
14
  end
10
15
 
@@ -1,3 +1,3 @@
1
1
  module Doorkeeper
2
- VERSION = "4.0.0.rc1"
2
+ VERSION = "4.0.0.rc2"
3
3
  end
@@ -1,9 +1,8 @@
1
1
  require File.expand_path('../boot', __FILE__)
2
2
 
3
- require 'action_controller/railtie'
4
- require 'sprockets/railtie'
3
+ require 'rails/all'
5
4
 
6
- Bundler.require :default
5
+ Bundler.require(*Rails.groups)
7
6
 
8
7
  require 'yaml'
9
8
 
@@ -20,38 +19,5 @@ module Dummy
20
19
  # Settings in config/environments/* take precedence over those specified here.
21
20
  # Application configuration should go into files in config/initializers
22
21
  # -- all .rb files in that directory are automatically loaded.
23
-
24
- # Only load the plugins named here, in the order given (default is alphabetical).
25
- # :all can be used as a placeholder for all plugins not explicitly named.
26
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
27
-
28
- # Activate observers that should always be running.
29
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
30
-
31
- if defined?(ActiveRecord) && Rails.version.to_i < 4
32
- config.active_record.whitelist_attributes = true
33
- end
34
-
35
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
36
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
37
- # config.time_zone = 'Central Time (US & Canada)'
38
-
39
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
40
- config.i18n.load_path += Dir[Rails.root.join('../../', 'config/locales', '*.{rb,yml}').to_s]
41
- # config.i18n.default_locale = :en
42
-
43
- # Configure the default encoding used in templates for Ruby 1.9.
44
- config.encoding = 'utf-8'
45
-
46
- # Configure sensitive parameters which will be filtered from the log file.
47
- config.filter_parameters += [:password]
48
-
49
- # Enable the asset pipeline
50
- config.assets.enabled = true
51
-
52
- # Version of your assets, change this if you want to expire all your assets
53
- config.assets.version = '1.0'
54
-
55
- I18n.enforce_available_locales = false
56
22
  end
57
23
  end
@@ -2,4 +2,4 @@
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
4
  # Initialize the rails application
5
- Dummy::Application.initialize!
5
+ Rails.application.initialize!
@@ -10,18 +10,10 @@ Dummy::Application.configure do
10
10
  # Configure static asset server for tests with Cache-Control for performance
11
11
  config.static_cache_control = 'public, max-age=3600'
12
12
 
13
- if Rails.version.to_i < 4
14
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
16
- end
17
-
18
- if Rails.version.to_i >= 4
19
- # Do not eager load code on boot. This avoids loading your whole application
20
- # just for the purpose of running a single test. If you are using a tool that
21
- # preloads Rails for running tests, you may have to set it to true.
22
- config.eager_load = false
23
- config.i18n.enforce_available_locales = true
24
- end
13
+ # Do not eager load code on boot. This avoids loading your whole application
14
+ # just for the purpose of running a single test. If you are using a tool that
15
+ # preloads Rails for running tests, you may have to set it to true.
16
+ config.eager_load = false
25
17
 
26
18
  # Show full error reports and disable caching
27
19
  config.consider_all_requests_local = true
@@ -0,0 +1,6 @@
1
+ # Require `belongs_to` associations by default. This is a new Rails 5.0
2
+ # default, so it is introduced as a configuration option to ensure that apps
3
+ # made on earlier versions of Rails are not affected when upgrading.
4
+ if Rails.version.to_i >= 5
5
+ Rails.application.config.active_record.belongs_to_required_by_default = true
6
+ end
@@ -143,6 +143,12 @@ module Doorkeeper
143
143
  subject.resource_owner_id = nil
144
144
  expect(subject).to be_valid
145
145
  end
146
+
147
+ it 'is valid without resource_owner_id' do
148
+ # For resource owner credentials flow
149
+ subject.application_id = nil
150
+ expect(subject).to be_valid
151
+ end
146
152
  end
147
153
 
148
154
  describe '#same_credential?' do
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: 4.0.0.rc1
4
+ version: 4.0.0.rc2
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: 2016-02-26 00:00:00.000000000 Z
12
+ date: 2016-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -249,6 +249,7 @@ files:
249
249
  - spec/dummy/config/environments/development.rb
250
250
  - spec/dummy/config/environments/production.rb
251
251
  - spec/dummy/config/environments/test.rb
252
+ - spec/dummy/config/initializers/active_record_belongs_to_required_by_default.rb
252
253
  - spec/dummy/config/initializers/backtrace_silencers.rb
253
254
  - spec/dummy/config/initializers/doorkeeper.rb
254
255
  - spec/dummy/config/initializers/secret_token.rb
@@ -390,6 +391,7 @@ test_files:
390
391
  - spec/dummy/config/environments/development.rb
391
392
  - spec/dummy/config/environments/production.rb
392
393
  - spec/dummy/config/environments/test.rb
394
+ - spec/dummy/config/initializers/active_record_belongs_to_required_by_default.rb
393
395
  - spec/dummy/config/initializers/backtrace_silencers.rb
394
396
  - spec/dummy/config/initializers/doorkeeper.rb
395
397
  - spec/dummy/config/initializers/secret_token.rb