Closed jrochkind closed 5 years ago
Looks like maybe it's here
And a replacement may be the kind of crazy ActiveRecord::Base.configurations.configurations.map(&:env_name)
.
But I'm not certain.
Looks like ActiveRecord::Base.configurations.configurations
is no longer a hash, but you can call to_h
on it to get a hash. I'll sort out a fix.
Try the latest in master
? Should hopefully work well.
Now on combustion master, it's:
private method `select' called for #<ActiveRecord::DatabaseConfigurations:0x00007f85ba37e1e0>
# /Users/jrochkind/code/rails/activerecord/lib/active_record/database_configurations.rb:182:in `method_missing'
# /Users/jrochkind/.gem/ruby/2.5.1/bundler/gems/combustion-99636cb97608/lib/combustion/database/reset.rb:59:in `resettable_db_configs'
Pushed a fix (and tested it locally first!)
Seems to work! (and my own project fails two tests and has two deprecation warnings on rails master, good to know!)
Thank you!
Release a bugfix patch?
I think I'll hold off on releases, given Rails itself hasn't released these changes. They may go and change things again!
Cool thanks. Without a release, I need to include combustion master-from-git in my Appraisal
file for rails edge, so I can test against it. Which works, is just a little bit messy. And I think makes travis take longer, I don't think it can cache gems installed direct from git.
https://github.com/jrochkind/attr_json/pull/35/files#diff-3bb7346aca79d8142e16e61372bd04dcR31
Yeah, that's the best way forward for the moment. It may slow down your build slightly, but the Rails repo is far bigger, so I'd expect Combustion is a spec of time in comparison :)
Closing this given this issue itself is resolved, even if we're waiting on Rails 6 (sounds like it's not going to be out for a few months or more).
@pat Rails 6.0.0.beta1 is out. Would it now be appropriate to have a version of combustion released that can work with it? I would really like that!
When combined with appraisal, testing on pre-release Rails versions is an especially pertinent use case I think, to find out early if there's a Rails backwards incompat that gets you.
Just released v1.1.0 with the Rails 6 fix - sorry for the delay! Was caught up with organising RubyConf AU, and then dealing with Bundler v2 challenges on old Rails versions.
If you try running a combustion-enabled app against rails master, you get an exception at
Combustion.initialize!
, ending in:https://github.com/pat/combustion/blob/20eb34e6299f6279dc7b9f4905c7ea990d436513/lib/combustion/database/reset.rb#L56
Not sure what it means that ActiveRecord::Base.configurations doesn't have a #keys anymore in Rails 6.