Possible bug with chained where methods on 3.0.4

+1 for reverting this ASAP. The reason was already very clearly explained in the 4th post of this thread. I believe, this is the most important point.

And to do it at all breaks the relational algebra idea badly.

Now, let me show you my real world tragedy.

# model class User   scope :admin, where(:id => [1, 2, 3, 4]) end

# controller def admin?   User.admin.where(:id => session[:user_id]).exists? end

Imagine what happened to my app!

As for the "OR" API, I think squirrel had the best syntax against ambiguity.

Book.written_by('david').published #=> AND

Book.or {   written_by('david')   published } #=> OR

+1 for reverting this ASAP. The reason was already very clearly explained in the 4th post of this thread. I believe, this is the most important point.

And to do it at all breaks the relational algebra idea badly.

Now, let me show you my real world tragedy.

# model class User   scope :admin, where(:id => [1, 2, 3, 4]) end

# controller def admin?   User.admin.where(:id => session[:user_id]).exists? end

Imagine what happened to my app!

As for the "OR" API, I think squirrel had the best syntax against ambiguity.

Book.written_by('david').published #=> AND

Book.or { written_by('david') published } #=> OR

This is fixed in https://github.com/rails/rails/commit/41c35abed778a7a03e7a9c14009321cd6bc11c26 and released in v3.0.5.rc1 right ? Shall we update the ticket https://rails.lighthouseapp.com/projects/8994/tickets/6188-model-name-for-default-submit-button-value-should-be-titleized and make sure it works the same way in master ?

Robert Pankowecki

It's fixed in 3.0.5.rc1 and in master. :slight_smile: