Re: [Rails-core] Improving the ActiveRecord query API

2012-12-11 Thread Ernie Miller
On Tuesday, December 11, 2012 6:35:48 AM UTC-5, Rodrigo Rosenfeld Rosas wrote: > > But I find this more consisent: > > post[:"dotted.column"].like('zomg%') > > than this: > > post.__send__(:"dotted.column").like('zomg%') > > You could actually support both syntaxes, but if you do so you wouldn't

Re: [Rails-core] Improving the ActiveRecord query API

2012-12-11 Thread Rodrigo Rosenfeld Rosas
Em 10-12-2012 19:40, Ernie Miller escreveu: On Monday, December 10, 2012 4:08:06 PM UTC-5, Rodrigo Rosenfeld Rosas wrote: What if a column is named "class"? I'd rather prefer something like that: Post.where { |post| post[:title].like('zomg%') | post[:class].like('bbq%')

Re: [Rails-core] Improving the ActiveRecord query API

2012-12-10 Thread Ernie Miller
On Monday, December 10, 2012 4:08:06 PM UTC-5, Rodrigo Rosenfeld Rosas wrote: > What if a column is named "class"? I'd rather prefer something like that: > > Post.where { |post| >post[:title].like('zomg%') | post[:class].like('bbq%') > } > > In Squeel's specific case, the DSL object is a

Re: [Rails-core] Improving the ActiveRecord query API

2012-12-10 Thread Rodrigo Rosenfeld Rosas
Em 07-12-2012 11:44, Ernie Miller escreveu: ... While the most common usage of Squeel is via instance_eval, and I know core is traditionally not in favor of such dark arts, it's perfectly possible to use Squeel syntax without instance_eval, as in: Post.where { |post| post.title.like('zomg%'

[Rails-core] Improving the ActiveRecord query API

2012-12-10 Thread Ernie Miller
Hi all, Back in the Rails 3.0 days, there was thought and discussion about how the AR query API might be improved to support more advanced queries, and in general make better use of some of the capabilities of ARel. I'd had some brief discussions with Pratik at the time, during which he mention