Skip to content

Commit

Permalink
Drop Application#scopes generator and warning
Browse files Browse the repository at this point in the history
It was introduced for upgrading from v2 to v3. It's not necessary in v4
and up.
  • Loading branch information
tute committed May 17, 2016
1 parent 127cee9 commit f685963
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 60 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ User-visible changes worth mentioning.
- [#823] Make configuration and specs ORM independent
- [#777] Add support for public client in password grant flow
- [#745] Add created_at timestamp to token generation options
- [#838] Drop `Application#scopes` generator and warning, introduced for
upgrading doorkeeper from v2 to v3.

---

Expand Down
5 changes: 0 additions & 5 deletions lib/doorkeeper/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ def self.configure(&block)
setup_orm_adapter
setup_orm_models
setup_application_owner if @config.enable_application_owner?
check_requirements
end

def self.configuration
@config || (fail MissingConfiguration)
end

def self.check_requirements
@orm_adapter.check_requirements!(configuration)
end

def self.setup_orm_adapter
@orm_adapter = "doorkeeper/orm/#{configuration.orm}".classify.constantize
rescue NameError => e
Expand Down
16 changes: 0 additions & 16 deletions lib/doorkeeper/orm/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,6 @@ def self.initialize_application_owner!

Doorkeeper::Application.send :include, Doorkeeper::Models::Ownership
end

def self.check_requirements!(_config)
if ::ActiveRecord::Base.connected? &&
::ActiveRecord::Base.connection.table_exists?(
Doorkeeper::Application.table_name
)
unless Doorkeeper::Application.column_names.include?("scopes")
migration_path = '../../../generators/doorkeeper/templates/add_scopes_to_oauth_applications.rb'
puts <<-MSG.squish
[doorkeeper] Missing column: `oauth_applications.scopes`.
Create the following migration and run `rake db:migrate`.
MSG
puts File.read(File.expand_path(migration_path, __FILE__))
end
end
end
end
end
end
34 changes: 0 additions & 34 deletions lib/generators/doorkeeper/application_scopes_generator.rb

This file was deleted.

This file was deleted.

0 comments on commit f685963

Please sign in to comment.