-
Notifications
You must be signed in to change notification settings - Fork 196
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
migrating fails on basic install b/c of new rails5 migration versioning #110
Comments
resolves tcocca#110
And if anyone on rails 5 runs into this that needs to migrate before waiting for fix, just follow the gem's README directions as normal, but after running
Then migrate as normal, and you should be 👍 |
I also came across this issue after installing this gem today. I looked at #111 and I noticed that the fixed for this has not been merged. This worked for me also if ActiveRecord.gem_version >= Gem::Version.new('5.0')
class ActsAsFollowerMigration < ActiveRecord::Migration["#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}"]; end
else
class ActsAsFollowerMigration < ActiveRecord::Migration; end
end
ActsAsFollowerMigration.class_eval do
def self.up
create_table :follows, force: true do |t|
t.references :followable, polymorphic: true, null: false
t.references :follower, polymorphic: true, null: false
t.boolean :blocked, default: false, null: false
t.timestamps
end
add_index :follows, ["follower_id", "follower_type"], name: "fk_follows"
add_index :follows, ["followable_id", "followable_type"], name: "fk_followables"
end
def self.down
drop_table :follows
end
end |
rails/rails#21538
Will submit PR shortly.
The text was updated successfully, but these errors were encountered: