Solvedrolify Directly inheriting from ActiveRecord::Migration is not supported
brandoncordell posts at
25 Answers
Share
Original✔️Accepted Answer
@jermaine Thanks. To prevent any which would already have a version tag, I changed your one-liner to the following:
grep -rl "ActiveRecord::Migration$" db | xargs sed -i "" "s/ActiveRecord::Migration/ActiveRecord::Migration[5.1]/g"
Note the $
.
Other Answers:
@redtachyons When running this on OSX I get the following error:
...extra characters at the end of d command
To get around this I had to add an empty string to sed.
This worked for me.
grep -rl "ActiveRecord::Migration" db | xargs sed -i "" "s/ActiveRecord::Migration/ActiveRecord::Migration[5.1]/g"
Thanks for the tip, Here is one liner to do that in linux
grep -rl "ActiveRecord::Migration$" db | xargs sed -i 's/ActiveRecord::Migration/ActiveRecord::Migration[5.1]/g'
thanks @brandoncordell
Thank u for the solution @brandoncordell
Related Issues:
38
rolify Directly inheriting from ActiveRecord::Migration is not supported
@jermaine Thanks To prevent any which would already have a version tag I changed your one-liner to t...
Rails: 5.1.0.beta1
Ruby: 2.4.0
Rolify: 5.1.0
This generated migration fails on this version of rails
Solution: I change
class RolifyCreateRoles < ActiveRecord::Migration
toclass RolifyCreateRoles < ActiveRecord::Migration[5.0]