Skip to content
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

2 generated migrations do not include Rails version number #1882

Open
2 tasks
camillevilla opened this issue Jan 12, 2018 · 2 comments
Open
2 tasks

2 generated migrations do not include Rails version number #1882

camillevilla opened this issue Jan 12, 2018 · 2 comments

Comments

@camillevilla
Copy link
Member

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:

Manual fixes:

See discussion in #1877

@jkeck
Copy link
Contributor

jkeck commented Jan 12, 2018

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

@mjgiarlo
Copy link
Member

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: samvera/hyrax#2361 -- I don't think this helps Spotlight, necessarily...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants