spotlight icon indicating copy to clipboard operation
spotlight copied to clipboard

2 generated migrations do not include Rails version number

Open camillevilla opened this issue 8 years ago • 2 comments

Rails version numbers are not getting appended to two generated ActiveRecord migrations. Users creating new apps get the following error after running rake db:migrate:

rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:

  class CreateFriendlyIdSlugs < ActiveRecord::Migration[4.2]
/Users/cvilla/scratchpad/app-name/db/migrate/20180112215454_create_friendly_id_slugs.rb:1:in `<top (required)>'

What we get:

class CreateFriendlyIdSlugs < ActiveRecord::Migration

What we want:

class CreateFriendlyIdSlugs < ActiveRecord::Migration[4.2]

Migrations to be fixed:

  • [ ] _create_friendly_id_slugs.rb
  • [ ] _devise_invitable_add_to_users.rb

Notes:

  • Why are Travis builds still passing?
  • This error has been happening since November 7, 2017 (#1859)

Manual fixes:

See discussion in #1877

camillevilla avatar Jan 12 '18 22:01 camillevilla

I wonder if this is a problem w/ friendly_id norman/friendly_id#817

jkeck avatar Jan 12 '18 22:01 jkeck

Looks like a bunch of PRs to address this are waiting in friendly_id: https://github.com/norman/friendly_id/pulls This does not inspire confidence that it'll be addressed.

(FWIW, we have a solution for this in Hyrax that was based on the solution in Devise: https://github.com/samvera/hyrax/pull/2361 -- I don't think this helps Spotlight, necessarily...)

mjgiarlo avatar Apr 18 '18 00:04 mjgiarlo