Created
July 7, 2020 21:15
-
-
Save rubysolo/3488d97555614918825b58e8301b3a6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bad < ActiveRecord::Migration | |
def change | |
Post.update_all(active: true) # <-- resolves to Post defined in app/models/post.rb | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Good < ActiveRecord::Migration | |
class Post < ActiveRecord::Base | |
end | |
def change | |
Post.update_all(active: true) # <-- resolves to Post defined above | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment