payolapayments / payola

Drop-in Rails engine for accepting payments with Stripe
http://www.payola.io
Other
819 stars 157 forks source link

rails g payola:install not working with Rails 5.1 #321

Closed naterexw closed 7 years ago

naterexw commented 7 years ago

In Rails 5, after running

rails g payola:install

and then running

rake db:migrate

produces the following error message:

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 CreatePayolaSales < ActiveRecord::Migration[4.2]
-e:1:in `<main>'
StandardError: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:

  class CreatePayolaSales < ActiveRecord::Migration[4.2]
-e:1:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
naterexw commented 7 years ago

I forked the gem and updated the migration files to use "ActiveRecord::Migration[5.1]".

Seems to fix the problem, I created pull request #322

alekseenko commented 7 years ago

@naterexw The error is already fixed. Just use master branch instead of RubyGems version

jscho13 commented 7 years ago

This issue still isn't fixed for me. When deploying to Heroku the migrations fail despite using payola payments 1.5.0

alekseenko commented 7 years ago

@jscho13 are you using master branch? In order to use latest changes you need to replace in your Gemfile

gem 'payola-payments'

with

gem 'payola-payments', git: 'https://github.com/payolapayments/payola'