Skip to content

storey:rollback in Rails 5.x breaks #52

Open
@ace-subido

Description

@ace-subido
# Gemfile.lock
    activerecord (5.2.0)
      activemodel (= 5.2.0)

$ rails storey:rollback
NoMethodError: undefined method `rollback’ for ActiveRecord::Migrator:Class

This is because storey uses ActiveRecord::Migrator.rollback in

::ActiveRecord::Migrator.rollback(
which doesn't exist in the ActiveRecord::Migrate class of active-record 5.2.0.

https://www.rubydoc.info/gems/activerecord/ActiveRecord/5.2.0/Migrator

Proposal

We can create a RollbackStrategy class/multiplexer that executes the correct rollback implementation based on the Rails version.

Apartment gem users also experienced this and implemented a similar fix influitive/apartment@06d80f0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions