Pratik Naik
cd994eff9a
Allow conditions on multiple tables to be specified using hash.
...
Examples:
User.all :joins => :items, :conditions => { :age => 10, :items => { :color => 'black' } }
Item.first :conditions => { :items => { :color => 'red' } }
Note : Hash key in :conditions is referring to the actual table name or the alias defined in query.
2008-06-28 01:27:51 +01:00
Tarmo Tänav
509374ebe2
Named bind variables can now be used with postgresql-style typecasts
...
For example :conditions => ['stringcol::integer = :var', { :var => 10 }]
will no longer raise an exception about ':integer' having a missing value.
2008-06-22 16:16:06 -07:00
Tarmo Tänav
c5d37c0662
Fix tests for postgres 8.3.x
...
Made test_with_limiting_with_custom_select not dependent on database
default order. Fixed tests with non-US monetary locale. The monetary
type is fixed precision so it should not expect the database to
return a float.
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-05-26 00:45:42 +01:00
Pratik Naik
802034ff5f
DRY associations code and improve eager loading tests.
2008-05-15 13:47:05 +01:00
John Devine
b28b54cab0
Make sure needed table joins are included :select option. [ #110 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-05-15 13:42:28 +01:00
John Devine
8ded457b1b
Added logic to associations.rb to make sure select_for_limited_ids
...
includes joins that are needed to reach tables listed in the :order
or :conditions options if they are not joined directly to the main
active_record table.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#109 state:resolved]
2008-05-06 21:47:10 +12:00
Pratik Naik
4f39382a2f
Ensure that respond_to? considers dynamic finder methods. Closes #11538 . [floehopper]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9235 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-06 22:26:15 +00:00
David Heinemeier Hansson
c10b2255b5
Fixed that ActiveRecord#Base.find_or_create/initialize would not honor attr_protected/accessible when used with a hash ( closes #11422 ) [miloops]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9090 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-25 23:56:48 +00:00
David Heinemeier Hansson
c6f2af5c31
Added ActiveRecord#Base.all/first/last as aliases for find(:all/:first/:last) ( closes #11413 ) [nkallen, thechrisoshow]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9085 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-24 19:59:22 +00:00
Rick Olson
081ddb6f24
Merge the has_finder gem, renamed as 'named_scope'. Closes #11404 [nkallen]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-24 02:50:02 +00:00
Jeremy Kemper
8352287c72
Fix edge case with colons in times interpreted as bind variables by requiring that bind vars start with a letter. Closes #10519 [matrix9180]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8936 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-27 23:05:59 +00:00
Jeremy Kemper
39814fcce0
Merge branch 'ar-test-cleanup' of git://git.geeksomnia.com/rails
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-21 17:20:51 +00:00
Jeremy Kemper
abdf546ad6
Support aggregations in finder conditions. Closes #10572 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8671 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-19 03:45:24 +00:00
Jeremy Kemper
1e70928014
Fix paths
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8661 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:31:37 +00:00
Jeremy Kemper
42b39ae3f2
Move tests to cases
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:30:42 +00:00