spritlesoftware / chargebee-rails-subscriptions

This gem provides developers with the ability to easily integrate chargebee's subscription management into their application backed by active record models.
https://rubygems.org/gems/chargebee_rails
Other
29 stars 25 forks source link

Migration Bug/Compat Fixes #17

Closed philipbjorge closed 5 years ago

philipbjorge commented 6 years ago

The technique below fixes the issue described here -- https://github.com/spritlesoftware/chargebee-rails-subscriptions/issues/16

migration_superclass = if ActiveRecord::VERSION::MAJOR >= 5
  ActiveRecord::Migration[4.2]
else
  ActiveRecord::Migration
end

The changes in install_generator.rb fix an issue where migrations are generated so quickly that they end up with the same timestamp, preventing the migration from running. The necessary module exists in Rails 4.2.4 -- https://github.com/rails/rails/blob/v4.2.4/activerecord/lib/rails/generators/active_record/migration.rb

Also, by adding force: true we prevent prompting the user for conflict resolution when we template over the automatically generated rails model from the line above.

dogweather commented 5 years ago

Please merge this. @spritle

philipbjorge commented 5 years ago

Opened for a year, no response.