Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix migration file for rails 5 #985

Closed
wants to merge 15 commits into from
7 changes: 2 additions & 5 deletions lib/generators/doorkeeper/migration_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ class Doorkeeper::MigrationGenerator < ::Rails::Generators::Base
desc 'Installs Doorkeeper migration file.'

def install
migration_template(
'migration.rb',
'db/migrate/create_doorkeeper_tables.rb',
migration_version: migration_version
)
@migration_version = Rails::VERSION::STRING[0..2].to_f
migration_template 'migration.rb.erb', 'db/migrate/create_doorkeeper_tables.rb'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Line is too long. [83/80]

end

def self.next_migration_number(dirname)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateDoorkeeperTables < ActiveRecord::Migration<%= migration_version %>
class CreateDoorkeeperTables < ActiveRecord::Migration<% if Rails::VERSION::MAJOR >= 5 %>[<%= @migration_version %>]<% end %>
def change
create_table :oauth_applications do |t|
t.string :name, null: false
Expand Down