David Heinemeier Hansson
8adb79b9b5
Stop logging SHOW FIELDS and SET SQL_AUTO_IS_NULL=0 for the MysqlAdapter as they only clutter up the log and offer no value [DHH]
2008-11-06 10:00:15 +01: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
Pratik Naik
dc37fdc480
Merge docrails. Remove unnecessary files.
2008-11-02 18:13:54 +05:30
Luca Guidi
5229fc4cc0
Make sure habtm use class variable to list association valid keys
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1310 state:committed]
2008-11-01 15:04:08 +01:00
Joshua Peek
4df5e1ae8f
It is not necessary to store QueryCache in a thread local since the cache is local to the connection object which is managed by the connection pool
2008-10-30 16:27:13 -05:00
Joshua Peek
0c84b6f9ed
Use database name in query cache thread local key [ #1283 state:resolved]
2008-10-30 15:48:03 -05:00
Jordi Bunster
a9e8168432
Ensure indices don't flip order in schema.rb [ #1266 state:committed]
...
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com >
2008-10-30 13:03:42 +01:00
David Heinemeier Hansson
8f0f078637
Make #destroy write 1 line into log (instead of 3) (Dmitry Sokurenko) [ #689 status:committed]
2008-10-29 10:53:33 +01:00
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
Michael Koziarski
9e2bb2caff
Remove reference to fformat to restore support for postgres gem.
2008-10-26 20:04:09 +01:00
Adam Majer
932dffc559
Fix binary data corruption bug in PostgreSQL adaptor
...
1. Move the binary escape/unescape from column to the driver - we should store binary data AR just like most other adaptors
2. check to make sure we only unescape bytea data
PGresult.ftype( column ) == 17
that is passed to us in escaped format
PGresult.fformat( column ) == 0
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1063 state:committed]
2008-10-25 12:54:48 +02: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
David Heinemeier Hansson
d224e6ccb1
Update CHANGELOGs with the last few fixes, set date for today
2008-10-24 13:08:47 +02:00
Jeremy Kemper
838cb1aa50
Skip collection ids reader optimization if using :finder_sql
2008-10-23 18:53:44 -07:00
David Heinemeier Hansson
5366e61458
Proper update call for gem server
2008-10-23 20:29:25 +02:00
David Heinemeier Hansson
eec6e0cbbd
Push to new gem server
2008-10-23 20:18:11 +02:00
David Heinemeier Hansson
57c31a380e
Prepare for Rails 2.2.0 [RC1]
2008-10-23 20:14:20 +02:00
Pratik Naik
a03e2b356c
Merge with docrails. Also add a rake task to generate guides in your rails application :
...
rake doc:guides
The rake task will generate guides inside doc/guides directory of your application. Open index.html to browse.
2008-10-21 18:33:40 +01: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
Pratik Naik
9cb5400871
Merge docrails
2008-10-16 22:13:06 +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
Hongli Lai (Phusion)
28393e6e9c
Add documentation for AbstractAdapter#sanitize_limit, and make its code more readable.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1068 status:committed]
2008-10-09 18:11:10 +02:00
Pratik Naik
a2932784bb
Merge docrails
2008-10-05 22:16:26 +01: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
4918e6de98
Remove HasManyAssociationStrategy and move the logic to ActiveRecord::Reflection::ThroughReflection.
2008-10-04 17:49:39 +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
Aliaksey Kandratsenka
f550c86257
Fix performance bug in AttibuteMethods#respond_to? in handling of private methods
...
We have hit dramatic increase in tests time after upgrading rails.
Profiling revealed this particular place. After this fix our test times returned
back to norm.
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1173 state:committed]
2008-10-04 17:48:13 +02:00
Aliaksey Kandratsenka
834361145a
made ConnectionPool#checkout more robust by trying to loot dead threads when pool is empty
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1169 state:committed]
2008-10-04 17:48:13 +02:00
Aliaksey Kandratsenka
21eb18a70c
Fix race in ConnectionPool#checkout
...
After releasing monitor some connection(s) may appear in pool before monitor is re-aquired.
When this happens we'll wait for connection which is already available.
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-10-04 17:48:13 +02:00
Aliaksey Kandratsenka
4cb3d27443
don't quote decimal values for mysql. It doesn't make sense and breaks in newer versions of mysql
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1168 state:committed]
2008-10-04 17:48:13 +02: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
Michael Koziarski
7553a23c0a
Remove AS for oracle compatibility
2008-10-03 21:35:01 +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
35d731ef0a
fix eager loading's :condition sanitizing expanding against the wrong table
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-09-29 17:49:44 +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
Tarmo Tänav
ea609b265f
Ignore all exceptions for validates_acceptance_of columns fetch so it can run even without a database connection
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-09-26 20:09:39 +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
Hongli Lai (Phusion)
72b772ae9b
Refactor configure_dependency_for_has_many to use a few more methods.
...
Add an additional conditions option to make it slightly easier for certain plugins.
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1087 state:committed]
2008-09-24 13:27:39 +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
Michael Koziarski
5f86451a4c
Bump the Version constants to align with the *next* release rather than the previous release.
...
This allows people tracking non-release gems or git submodules to use the constants.
2008-09-22 21:32:12 +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