5 ms·
I feel your pain, I have a bunch of legacy 2.2 and 2.3 apps. I moved all dependency management from config.gem over to Bundler, and haven't had a dependency is
by elektronaut 15y ago
I feel your pain, I have a bunch of legacy 2.2 and 2.3 apps.
I moved all dependency management from config.gem over to Bundler, and haven't had a dependency issue since.
- nirvdrum 15y agoI wish I was still on 2.3. I made the jump and am now running 3.1, after putting off upgrading for so long. I bit the bullet because most plugins simply don't backport bug or security fixes. But hardly a day goes by that I don't wish I was still on 2.3.
- boundlessdreamz 15y agoWhy ? I found 3.1 upgrade with all the asset compilation etc, a bit painful but 3.0 brought in a lot of nice changes. (Arel for one)
- nirvdrum 15y agoIt's considerably slower than 2.3 and the API fell apart. It's this weird system that looks modular, but including any given module into your code will almost certainly fail due to weird dependency graphs or because some modules seem to only work when injected into certain classes. This makes it incredibly frustrating to debug. Generally I like Arel, but the changed behavior around default_scope is maddening. And I've found several pretty big bugs that have been annoying to work around.
- boundlessdreamz 15y ago"Generally I like Arel, but the changed behavior around default_scope is maddening. And I've found several pretty big bugs that have been annoying to work around." Can you expand on this?
- nirvdrum 15y agoSure. I usually add a :default_scope with an order clause to my models, since it makes using :first and :last considerably nicer. If you want to do sort in the opposite direction, you can't just add .order to your calls (this used to override the default scope in Rails 2.3), since Arel will just translate that to the senseless "ORDER BY id ASC, id DESC". The way around this is to use :reorder, but :reorder doesn't work the same way and can generate invalid SQL if you're prefetching included associations. So, you're left with :unscoped, but that's insanely insecure because it drops any foreign key scopes you had in place. Likewise, it only normalizes identical order clauses if you use the exact same casing. This one is a bit more esoteric, but if your default_scope is to order by "id asc" and you reorder by "id ASC", Arel will produce "ORDER BY id asc, id ASC". If they match in case, however, it'll be normalized to a single clause. I haven't found the time to attempt a proper fix to any of these problems yet.
- jaylevitt 15y ago@jonleighton committed a big refactor yesterday that might be a good sign here; looks like a lot of the old monolithic AR code is now new-style Concerns, more of a defined API, etc. If the root problem here is ARel itself, that won't help, but if it's really AR::Relation, maybe Rails is moving in the right direction. We use user-defined functions in Postgres, and I have the same complaint - in theory, the move toward composable relations is great, but in practice, there are so many hitches and gotchas and prior assumptions and backwards-compatibility requirements that it's never clean.