Tests. Yes :)
and even more experimentally, with adding placeholders to allow a
query to be evaluated multiple times in different dynamic
contexts:
https://github.com/codders/arel/commit/4b9ae3de9edee084303e6f29145b0e4ce5e04481
There are no tests for this, so I'm not sure what it actually does.
Is "placeholder" in the SQL BNF?
No, I don't imagine so. The idea with the placeholders is that you could
have one query which serializes differently to SQL (or through any of
the visitors) depending on the dynamic value of the placeholders. The
effect I want (and am using in my local repo) is not to have to define
the values of all the query terms at query build time:
@placeholders = { :username => "bob" }
query =
@users.project(@users[:id]).where(@users[:name].eq(Arel::Nodes::Placeholder.new(:username,
@placeholders)))
query.to_sql => "SELECT `users`.`id` FROM `users` WHERE `users`.`name`
= 'bob'"
@placeholders[:username] = "adam"
query.to_sql => "SELECT `users`.`id` FROM `users` WHERE `users`.`name` =
'adam'"
Make sense? Sound useful? I'm not sure that's the most elegant API in
the world (in fact I'm pretty sure it's not), but I'm open to
suggestions as to pretty ways to achieve the same thing.
So... a) How can I get my bugfix merged - who should I talk to,
what else do you need?
b) What's the best forum for discussing / getting involved in Arel
development.
For now, we should discuss here. I'll open a mailing list soon, and we
can move there eventually. :-)
Okidoke :)
--
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.