-
Notifications
You must be signed in to change notification settings - Fork 794
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
Compatibility with active record 3.0 and 3.1 #84
Conversation
Calling `super()` makes the active record adapter compatible with older versions of active record.
Not sure why travis is not getting this commit, looking on this. |
Not sure how this works without |
I know, but there is legacy applications out there and we have no other option since tire isn't compatible with elastic search 1.x. This is the only necessary change right now and I supposed it was a bug since the gem allows it to be bundled on rails 3.0. We may be blocked in the future because a missing feature on 3.0 or 3.1 but when we get to this, we may drop the support to 3.0 and 3.1 entirely. Wdyt? |
@karmi signed 👍 |
About the code, I've read somewhere (I don't remember where) that calling The only gotcha is that we must specify the params explicit, that's why I used |
@sobrinho Sounds like a nice trick, didn't knew about it :) Will split the commit and verify the code next weeks, thanks for the patch! |
There are following issues with the 3.x Gemfiles
For some reason the error occurs only if you run the spec with the provided custom rake task. #works
elasticsearch_model$ BUNDLE_GEMFILE=./gemfiles/3.0.gemfile bundle exec rake test TEST=test/integration/acticve_record_associations_test.rb
#fails with connection not established error in acticve_record_association_test
elasticsearch_rails$ TEST_BUNDLE_GEMFILE=./gemfiles/3.0.gemfile bundle exec rake test:integration --trace
I'd suggest we move the ActiveRecord declarations into the setup block or just call setup before any declaration. @sobrinho
Prior to mongoid 3, they used to have another way to connect to db and did not shipped
|
@dre-hh I will work on this today and update the PR, thanks for the feedback! |
So, started looking into this:
|
@sobrinho What should we do with this old story? :) |
@karmi I'm on vacation right now but keep it open and I will fix the problems in a couple weeks :) |
@sobrinho Sure thing, enjoy your vacation and ping me when you're back! |
@karmi we've got rails 4.2 by the time now. I've personally upgraded some rails projects from 3.0 to 3.2. I don't remember wether there was some minor incompatibilities in AR. The whole process was actually pretty painless. I suggest we close this issue and encourage people to upgrade at least to AR 3.2 |
@dre-hh Agreed that Rails 3.0 is a legacy thing now, however, the gem works with that version, so I'm not sure if we should remove it... On the other hand, I'm all for adding support or 3.2.x and getting rid of 3.0.x if it would complicate things. |
Closing, we finally upgraded the project, thanks! |
@sobrinho, that's the best outcome! :) Best of luck! |
Calling
super()
makes the active record adapter compatible with older versions of active record.