Ken Collins
8e4624be9e
Remove SQL Server cases from tests for latest adapter work to pass rails expected behavior.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-11-19 18:00:56 +01:00
Sven Fuchs
12118963ac
use :en as a default locale (in favor of :en-US)
...
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com >
2008-11-18 14:23:53 +01:00
Tom Stuart
32cb2345a5
Fix default_scope to work in combination with named scopes
...
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com >
2008-11-17 22:00:14 +01:00
Pratik Naik
2530d0eea8
Added default_scope to Base [ #1381 state:committed] (Paweł Kondzior)
2008-11-16 23:36:41 +05:30
David Heinemeier Hansson
ca23287b44
Revert "Added default_scope to Base [ #1381 state:committed] (Paweł Kondzior)" -- won't gel with threads.
...
This reverts commit ff594b2bc9 .
2008-11-16 16:35:52 +01:00
David Heinemeier Hansson
ff594b2bc9
Added default_scope to Base [ #1381 state:committed] (Paweł Kondzior)
2008-11-16 16:01:18 +01:00
Jeremy Kemper
5fe543b629
Add create_fixtures method for tests
2008-11-15 12:31:54 -08:00
Jeremy Kemper
160b8a8344
Set up fixtures for AR tests
2008-11-15 12:30:02 -08:00
Jeremy Kemper
eeea1a26ec
Merge branch 'master' into testing
2008-11-15 12:21:04 -08:00
Matt Jones
d3fd997109
fix assignment to has_one :through associations.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-11-15 18:20:39 +01:00
Amos King
db7daa04b8
Fix typo in pool_conections_test [ #1350 state:committed]
...
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com >
2008-11-14 11:54:05 +01:00
Ken Collins
57d795bad4
Make sure any Fixnum returned by a DB sum is type cast to a Float before standard converstion to a BigDecimal [ #8994 state:resolved]
...
Signed-off-by: Joshua Peek <josh@joshpeek.com >
2008-11-13 10:45:57 -06:00
Jeremy Kemper
ace9e533dc
Merge branch 'master' into testing
2008-11-08 18:58:29 -05:00
Jeremy Kemper
dd77733f2f
Timeout the connection pool monitor on ruby 1.8 only
2008-11-08 00:27:18 -05:00
Jeremy Kemper
0994d11f26
Merge branch 'master' into testing
2008-11-07 19:55:29 -05:00
Jeremy Kemper
1d803e5189
Update AR tests
2008-11-07 16:22:56 -05:00
Jeremy Kemper
b0ee1bdf26
Remove fixtures from Test::Unit::TestCase. Mix in AR::TestFixtures instead.
2008-11-07 15:40:56 -05:00
Tekin Suleyman
32a5cfcd7f
Added tests for HABTM associations with counter_sql
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1102 state:committed]
2008-11-07 07:50:30 +00:00
Pratik Naik
0832bc63f4
Make sure ActiveRecord::Base.connected? doesn't raise an exception for defined connections
2008-11-06 01:29:09 +05:30
Wes Oldenbeuving
32089cbcc9
Ensure ActiveRecord::ConnectionPool.connected? handles undefined connections. [ #936 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-11-06 00:24:09 +05:30
David Heinemeier Hansson
c94ba8150a
Fixed that serialized strings should never be type-casted (i.e. turning "Yes" to a boolean)(Andreas Korth) [ #857 state:committed]
2008-10-27 17:16:45 +01:00
Mike Gunderloy
5c97d4ff29
"raise NoMethodError" raises NoMethodError. Raise it with NoMethodError.new instead.
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-10-25 14:52:44 +05:30
Ken Miller
8a77c4abfa
Fixed issue where block is not called on the very first invocation of a find_or_create_by_ automatic finder.
...
[#1224 state:committed]
2008-10-24 21:35:05 +02:00
Jeremy Kemper
838cb1aa50
Skip collection ids reader optimization if using :finder_sql
2008-10-23 18:53:44 -07:00
Pratik Naik
95c609357e
Ensure association proxy responds to private class methods defined in associated class. [ #1083 ]
2008-10-16 23:17:49 +02:00
Ian White
517bc500ed
Allow class methods to be sent (via #send) to association proxy (fix for bug introduced by 691aa20) [ #1083 ]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-10-16 10:41:48 +02:00
Pratik Naik
691aa20280
Ensure methods called on association proxies respect access control. [ #1083 state:resolved] [Adam Milligan, Pratik]
2008-10-13 19:02:34 +02:00
Michael Koziarski
cb45ee344d
Remove the functionality introduce in 28d3390
...
There are several situations it doesn't cater for, and the inconsistency isn't worth blocking 2.2.
2008-10-10 17:04:46 +02:00
Will Bryant
4c05055487
explicitly including child associations that are also included in the parent association definition should not result in double records in the collection/double loads ( #1110 )
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1110 state:committed]
2008-10-10 16:58:39 +02:00
Pratik Naik
9599948fbc
Ensure Model.sum and Model.avg typecast appropriately. [ #1066 state:resolved]
...
Model.sum delegates typecasting to the column being summed. If that's not feasible, returns a string.
Model.avg always returns big decimal.
2008-10-04 20:13:44 +01:00
Pratik Naik
25ca21ae21
Introduce ActiveRecord::Reflection::ThroughReflection to simplify hm:t reflection logic
2008-10-04 17:49:39 +01:00
Zach Dennis
95e1cf4812
Fix has_many :through when the source is a belongs_to association. [ #323 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-10-04 17:49:39 +01:00
Lawrence Pit
7659fb6a2b
Try reloading model on class mismatch [ #229 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-10-04 17:49:38 +01:00
Luca Guidi
1bc267d216
Make sure recreate MySQL test database with the proper encoding and collation [ #1165 state:resolved]
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1165 state:committed]
2008-10-03 22:08:55 +02:00
Eloy Duran
8d337e9ec2
Dynamic finders should use the ActiveRecord::Base::find method instead of ::find_initial, :find_last, and ::find_all.
...
This is so when people override ActiveRecord::Base::find, the new ::find method will also be invoked by the dynamic finders.
Associations for instance do go through ::find, so this makes it more consistent.
Also removed the unnecessary deprecation silence blocks.
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1162 state:committed]
2008-10-03 21:28:11 +02:00
Will Bryant
8233f8314b
wrote a test showing eager loading's misbehavior (sanitizing against the wrong table) when the association has a :conditions hash
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-09-29 17:49:44 +02:00
Adam Milligan
4d9a7ab5f5
Changed ActiveRecord attributes to respect access control.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1084 state:committed]
2008-09-24 19:40:07 +02:00
Pivotal Labs
487758b3b8
Allowed passing arrays-of-strings to :join everywhere. Merge duplicate join strings to avoid table aliasing problems.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1077 state:committed]
2008-09-24 13:26:06 +02:00
Hongli Lai (Phusion)
70b8ea4fa6
Make AssociationCollection start transactions in the correct database.
...
AssociationCollection now starts transactions by calling
AssociationCollection#transaction instead of @owner.transaction or
@reflection.klass.transaction.
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1081 state:committed]
2008-09-23 20:32:01 +02:00
Michael Koziarski
638bd19c7f
Merge branch 'patches' into multibyte
2008-09-22 21:35:35 +02:00
Jan De Poorter
050e58441b
Association#first and last should not load the association if not needed. [ #1091 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-09-22 18:22:30 +01:00
Hongli Lai (Phusion
46939a9b5a
Add Model#delete instance method, similar to Model.delete class method. [ #1086 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-09-21 22:53:44 +01:00
Manfred Stienstra
1585a7ed02
Change all calls to String#chars to String#mb_chars.
2008-09-21 18:01:15 +02:00
Manfred Stienstra
52f8c04e1e
Fix a test that assumes .mb_chars to always return an instance of the proxy_class.
2008-09-21 17:30:16 +02:00
Manfred Stienstra
7329990d86
Change all calls to String#chars to String#mb_chars. Remove a exception for Ruby <= 1.9.
2008-09-21 17:27:25 +02:00
Adeh DeSandies
de96a8666d
applied patch to fix the associations with blocks in modules bug from an old trac ticket
2008-09-20 13:46:09 -07:00
Sven Fuchs
a3b7fa78bf
I18n: Introduce I18n.load_path in favor of I18n.load_translations and change Simple backend to load translations lazily. [ #1048 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-09-20 19:26:16 +01:00
Nathaniel Talbott
9d7f186f74
Fixed an error triggered by a reload followed by a foreign key assignment.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-09-20 14:16:43 +02:00
miloops
dc8bf7515d
When counting grouped records the target should be loaded to return a valid groups count result.
...
Without this change count_records will group for the count in the query and return erroneous results.
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#937 state:committed]
2008-09-15 18:32:05 +02:00
Frederick Cheung
f636c6fda0
stop AR's debug.log filling with warnings about not being able to load fixture classes
...
[#1045 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-09-14 18:57:39 -07:00