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 for Directly inheriting from ActiveRecord::Migration is not supported #160

Closed
wants to merge 1 commit into from

Conversation

an-nasir
Copy link

Added migration version to handle 'Directly inheriting from ActiveRecord::Migration is not supported" while running rails/rake db:migrate

…ord::Migration is not supported', this error
@@ -9,7 +9,7 @@ def self.up
t.timestamps
end

add_index :rates, :rater_id
# add_index :rates, :rater_id
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this commented out?

if rails5?
"[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
else
"[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this needed? I saw some of the gems didn't include this for Rails lower than v5 though

@an-nasir
Copy link
Author

an-nasir commented Oct 3, 2018 via email

@yihyang
Copy link
Collaborator

yihyang commented Oct 4, 2018

Devise didn't include the else condition though

https://github.com/plataformatec/devise/blob/master/lib/generators/active_record/devise_generator.rb#L94-L98

     def migration_version
       if rails5_and_up?
         "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
       end
     end

@an-nasir
Copy link
Author

an-nasir commented Oct 4, 2018 via email

@yihyang
Copy link
Collaborator

yihyang commented Oct 4, 2018

@an-nasir I can't make changes the branch on your repo though. Is it ok if I create another PR or do you want to update it

@an-nasir
Copy link
Author

an-nasir commented Oct 4, 2018 via email

@yihyang yihyang mentioned this pull request Oct 4, 2018
@yihyang
Copy link
Collaborator

yihyang commented Oct 4, 2018

@an-nasir I have created a new PR: #162

@yihyang
Copy link
Collaborator

yihyang commented Oct 4, 2018

@an-nasir I'm closing this PR as it has been fixed in #162 as we have discussed

@yihyang yihyang closed this Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants