-
Notifications
You must be signed in to change notification settings - Fork 213
ActiveRecord default where no longer works #75
Comments
The value should be a string, not a symbol. That will fix the issue. Thanks! Sent from my iPhone On Nov 7, 2011, at 11:51 PM, Dmytrii Nagirniak
|
No, that's not true for ActiveRecord. The value doesn't need to be a string. It only must respond to There are 2 problems though:
|
I understand that this isn't the case for stock ActiveRecord -- this is the case for Squeel, however. See #67 for more details and discussion on this one. |
Look, if there is no way of "enhancing" AR without breaking it. Then probably squeel should provide a "save" option. I agree with guys there that "enhancement" should improve on something, not change. Also I don't see any reason to restrict the options to strings only. The whole Ruby works based on whether it responds to something or not. So what I propose is to create and extension "safe" that would swap back the default implementation of AR/Arel. |
Or maybe just use bang notion in "safe" mode: |
Think of it as |
I just encountered this problem and agree that we need a solution for this. Breaking standard AR functionality / behavior seems like a bad idea. |
I have an existing Rails 3.1 app with complex scopes that use simple hash conditions like
Article.published
.It worked before I added squeel. The problem is that its
.to_sql
started to generate incorrect SQL:Not the WHERE clause and the
approved
column that doesn't exist. It was specified on the scope:I would prefer to keep existing AR queries and use squeel here and there.
Or maybe I'm just doing something wrong?
Also tried to
config.load_core_extensions :symbol
, but it only seems compatibility with MetaWhere.The text was updated successfully, but these errors were encountered: