-
Notifications
You must be signed in to change notification settings - Fork 212
ActiveRecord 4.1 support #307
Comments
+1, I tried to inspect it but I stuck at the same line. |
I think was able to chain onto |
+1, support would be great |
Having the same issue with activerecord-hackery/polyamorous#9, the |
+1 |
@ernie :) |
+1 |
1 similar comment
👍 |
I would quite like to get this working and having taken a look at the above link, the first thing I'm running into is that in the Preloader Extensions we have lost Preloader.run, so that method chain won't run any more. Apparently it's all "internal to rails" and "low level" so we shouldn't be using it anyway, but if anyone has any suggestions about what it is being used for I might be able to put together a fix. |
Unfortunately the nature of Squeel requires it to be quite tightly integrated with Rails, which can mean that we have no choice but to use those internal things that we shouldn't be using. Fixing compatibility with 4.1 is an interesting challenge that I wouldn't mind having a shot at but it's a fairly long way down my priority list. |
I'm sorry but what's the solution to this then? I'm getting the same error with Polyamorous from the activerecord-hackery repo and ActiveRecord 4.1. Is it either stay on AR 4.0.4 or remove all traces of Squeel from our app? |
@kakubei Ah! Sounds familiar. I'm stuck on Rails 3.0.x because of meta_where dependency. I'm in the mist of converting all meta_where code to pure arel. |
@kakubei Yes. Or fix it. =P |
@chewi If I could fix it, believe me I would but that's beyond my current knowledge. |
I ended up ripping out squeel completely. The query interface in Rails has matured quite a bit and the more complex queries I had were quite easy to rewrite to use arel or regular queries. The biggest advantage of squeel, which is the fact that you can easily refer to columns in different tables turned out to promote misplaced code (queries in wrong models etc), so rewriting helped in spotting those problems. Squeel definitely has its uses. But for someone like me, who uses it just for the convenience, it just guides you to use wrong coding practices. |
Well, I loved squeel. It allowed me to write much more elegant and readable queries, but now I'm in the process of removing it from all my code since I can't upgrade AR. It does give you pause when you rely on gems which you don't know if they'll be around next week. |
Have a look here, it might be the perfect balance between removing the 'magic' of squeel and keep the arel verbosity down: https://github.com/camertron/arel-helpers |
@gamov Thanks! It can't do everything I use Squeel for but it's certainly not a bad compromise. |
Squeel is central to our product design and I love it!! Does anyone know how hard it would be to upgrade? I want to help! |
+1 |
+1, we need someone to fix it! |
I created a fork at https://github.com/bigxiang/squeel and tried to make Squeel compatible with Rails 4.1 and Rails 4.2, but I can't promise all features are well even I had passed all tests under Rails 4.1 and 4.2 ( Gemfile: gem 'polyamorous', git: 'git://github.com/activerecord-hackery/polyamorous.git'
gem 'squeel', git: 'git://github.com/bigxiang/squeel.git', branch: 'ruby-2-rails-edge' By the way, AR 4+ has improved a lot, I think it's good enough for common cases. |
I think it could be closed after the branch was merged, Thank you very one :) |
Beta1 has been out a while so I thought I'd give it a try. After scratching my head for a while, I realised that I needed to create a squeel/adapters/active_record/4.1 directory but that wasn't enough. The preloading stuff has changed quite a lot. In particular, rails/rails@6e5a2cb removed the
run
method that we have been applying alias_method_chain to. I'm afraid I am quite lost at this point.The text was updated successfully, but these errors were encountered: