Skip to content

Instantly share code, notes, and snippets.

@rubysolo
Created July 7, 2020 21:15
Show Gist options
  • Save rubysolo/3488d97555614918825b58e8301b3a6f to your computer and use it in GitHub Desktop.
Save rubysolo/3488d97555614918825b58e8301b3a6f to your computer and use it in GitHub Desktop.
class Bad < ActiveRecord::Migration
def change
Post.update_all(active: true) # <-- resolves to Post defined in app/models/post.rb
end
end
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