-
-
Notifications
You must be signed in to change notification settings - Fork 418
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
Support for ActiveRecord 5 #129
Comments
I just ran across an issue that seems to be related to # config/initializers/flipper.rb
module MyApplication
def self.flipper
@flipper ||= begin
adapter = Flipper::Adapters::ActiveRecord.new
Flipper.new(adapter)
end
end
end
require 'flipper/middleware/memoizer'
Rails.application.config.middleware.use Flipper::Middleware::Memoizer, -> { MyApplication.flipper } I also have this initializer generated by # config/initializers/active_record_belongs_to_required_by_default.rb
# Be sure to restart your server when you modify this file.
# Require `belongs_to` associations by default. This is a new Rails 5.0
# default, so it is introduced as a configuration option to ensure that apps
# made on earlier versions of Rails are not affected when upgrading.
Rails.application.config.active_record.belongs_to_required_by_default = true At some point, I noticed that After I changed my |
Thanks for opening the issue and testing. I don't think there should be anything big that would be incompatible, but we should definitely start testing. Step 1 is probably to get a rails 5 gemfile going that runs in travis ci. It doesn't make sense that flipper would affect initializers like you've mentioned. Seems like something else complex is going on there, but let me know if it is flipper. |
@jnunemaker It didn't make sense to me either, but |
I just realized I already have rails 5 in the matrix for ci. It was on beta3, so I just updated it to rc1. Pretty sure that everything is good as the tests have been passing so I'm going to close this, but let me know if you run into any issues. As far as the issue you mentioned above, seems really weird. The only thing that I do in the AR adapter is require "active_record" and setup a couple of models, so it doesn't seem related. Please let me know if you find that it is. |
@jnunemaker Looks like the version dependency for |
Just waiting on CI: I'll release after CI is green. |
0.9.1 is out with rails 5 support. Let me know if you hit any issues. |
Thanks @jnunemaker! |
@jnunemaker We came across the same issue with See rails/rails#23589, collectiveidea/delayed_job_active_record#128, collectiveidea/delayed_job_active_record#106 (PR), and heartcombo/devise@c2c74b0 |
This prevents overwriting the setting in Rails 5, as described in flippercloud#129
FWIW, we just ran into this as well. Using flipper v0.9.2 and flipper-active_record v0.9.2 with rails v5.0.0.1. @md5's suggestion below resolved the issue for us for now:
I had a go at implementing the Thanks for tracking this down, @md5! 😄 |
It looks like Rails 5.0.0 will be released relatively soon, so I wanted to open an issue regarding support for ActiveRecord 5.
Since the version range for
activerecord
is set to">= 3.2", "< 5"
, Bundler will happily allow it to be installed with5.0.0.rc1
, which is what I have in my application (5.0.0.rc1
is considered< 5
by RubyGems). So far, I haven't noticed any incompatibilities, but I haven't done extensive testing beyond basic feature flag changes.The text was updated successfully, but these errors were encountered: