Frederick Cheung
d51a39ff50
Deal with MySQL's quirky handling of defaults and blob/text columns
...
[#1043 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-09-14 17:11:22 -07:00
gbuesing
d95943b276
Multiparameter attributes skip time zone conversion for time-only columns [ #1030 state:resolved]
2008-09-14 18:16:50 -05:00
miloops
9c4730d01e
Base.skip_time_zone_conversion_for_attributes uses class_inheritable_accessor, so that subclasses don't overwrite Base [ #346 state:resolved]
2008-09-14 17:18:17 -05:00
Pratik Naik
a17027d13a
Merge docrails
2008-09-13 20:28:01 +01:00
Rich Cavanaugh
113de01eaf
Allow for the dirty tracking to work with the aliased name of aliased attributes.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#812 state:committed]
2008-09-13 11:41:14 +02:00
Jon Leighton
fcf31cb752
Support for updating a belongs to association from the foreign key (without saving and reloading the record)
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#142 state:committed]
2008-09-13 11:08:29 +02:00
Michael Koziarski
095ad690f3
Remove the .to_s fix in validates_uniqueness_of, as Chars get quoted correctly.
2008-09-11 22:51:57 +02:00
Manfred Stienstra
babbc1580d
Fix ActiveRecord::Base.quote_bound_value for ActiveSupper::Multibyte::Chars values.
...
- Adds String#acts_like_string?
- Adds Chars#acts_like_string?
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1029 state:committed]
2008-09-11 22:51:26 +02:00
wmoxam
923f4ecad2
Fixes validates_uniquness_of problem with case insensitive string containing newline characters
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-09-11 17:40:14 +02:00
rsl
6ce13429cb
fixed association preloading to use = instead of IN when there's only one record
...
[#1013 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-09-10 14:11:00 -07:00
Pratik Naik
9994f0d902
Revert "Add :accessible option to Associations for allowing mass assignments using hash. [ #474 state:resolved]"
...
This reverts commit e0750d6a5c .
Conflicts:
activerecord/CHANGELOG
activerecord/lib/active_record/associations.rb
activerecord/lib/active_record/associations/association_collection.rb
2008-09-10 18:50:01 +01:00
Rob Anderton
b518b6c0d3
Expanded documentation for new composed_of options
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#892 state:committed]
2008-09-10 18:28:57 +02:00
Rob Anderton
2cee51d5c1
Added :constructor and :converter options to composed_of and deprecated the conversion block
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-09-10 18:28:47 +02:00
Tarmo Tänav
7c9851dbb6
Support :limit on update_all so that has_many with :limit can be safely updated
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-09-10 13:41:49 +02:00
David Heinemeier Hansson
6dc9173a63
Missing doc updates
2008-09-09 23:59:54 -05:00
miloops
567392bff3
Added find_last_by dynamic finder [status:committed #762 ]
...
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com >
2008-09-09 23:44:52 -05:00
Hongli Lai (Phusion)
1398db0128
Add special AssociationReflection methods for creating association objects, and modify the code base to use those methods instead of creating association objects directly. This allows plugins to hook into association object creation behavior.
...
[#986 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-09-09 13:13:12 -07:00
Hongli Lai (Phusion)
1692940441
Make the options that has_many, belongs_to and other association generation methods can accept, configurable.
...
[#985 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-09-09 12:50:32 -07:00
Michael Koziarski
07913788f9
Interpolation requires double quotes
2008-09-09 21:16:06 +02:00
Jeremy Kemper
4f6875296f
Revert "Revert "Raise UnknownAttributeError when unknown attributes are supplied via mass assignment""
...
This reverts commit 41efd73887 .
2008-09-08 09:45:26 -07:00
Jeremy Kemper
41efd73887
Revert "Raise UnknownAttributeError when unknown attributes are supplied via mass assignment"
...
This reverts commit 108db00aa9 .
2008-09-06 21:01:45 -07:00
David Heinemeier Hansson
227ee2ecb4
Use a more sensible resolution on the new millisecond benchmarks
2008-09-05 14:58:34 +02:00
David Heinemeier Hansson
de0e7507de
Changed all benchmarking reports to be in milliseconds
2008-09-05 14:22:57 +02:00
Michael Koziarski
ca5ffd10b9
Handle connection timeouts with a slightly nicer error message.
2008-09-04 17:02:04 +02:00
Nick Sieger
0d9e238cc9
Remove flawed execute("ROLLBACK") approach; #reset! defaults to nothing
...
Will need community help to fill out what #reset! should do for each adapter
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-09-04 15:45:00 +02:00
Nick Sieger
a3f12f575d
Default connection allow_concurrency to false (for PostgreSQL)
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-09-04 15:44:05 +02:00
Nick Sieger
7ba2872615
Deprecate verification_timeout and verify before reset
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-09-04 14:36:09 +02:00
Jeremy Kemper
039d78a7d8
still need to track whether we're the toplevel transaction
2008-09-04 13:17:00 +02:00
Jeremy Kemper
045713ee24
PostgreSQL: introduce transaction_active? rather than tracking activity ourselves
2008-09-04 12:17:56 +02:00
Pratik Naik
6ef35461dc
Merge docrails
2008-09-03 17:58:47 +01:00
Clemens Kofler
288e947ae1
Some performance goodness for inheritable attributes.
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-09-03 00:55:23 +02:00
Clemens Kofler
4d092ba208
Some performance goodness for AR.
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-09-03 00:55:23 +02:00
Clemens Kofler
ba3ecf53b4
Some performance goodness for AR associations.
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-09-03 00:55:22 +02:00
Clemens Kofler
1646e8c364
More symbols for send and respond_to?.
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-09-03 00:55:22 +02:00
Jeremy Kemper
6f932b4790
Database connections are now pooled, one pool per #establish_connection call.
...
Pools start out empty and grow as necessary to a maximum size (default is 5,
configure size with key 'pool' in your database configuration). If no
connections are available, a thread will wait up to a 'wait_timeout' time
(default is 5 seconds).
Connections are verified and reset when checked out from the pool (usually
upon first access to ActiveRecord::Base.connection), and returned back to the
pool after each request.
If you would like to use connection pools outside of ActionPack, there is an
ActiveRecord::Base.connection_pool method that gives you access to the pool,
and you can manually checkout/checkin connections, or supply a block to
ActiveRecord::Base.connection_pool.with_connection which takes care of the
checkout/checkin for you.
[#936 state:resolved]
2008-09-02 18:32:54 +02:00
Iain Hecker
76797b4439
translates when a message symbol has been set on builtin validations
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-08-31 13:24:08 -07:00
miloops
6183e55f71
Use reflection primary_key instead of id for when selecting association ids.
...
[#906 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-08-30 17:39:30 -07:00
miloops
b163d83b8b
Performance: Better query for ASSOCIATION_ids. Select only ids if the association hasn't been loaded.
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-08-30 15:24:09 -07:00
Tom Stuart
7f179f8540
Make NamedScope#size behave identically to AssociationCollection#size. [ #933 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-08-29 22:18:49 +01:00
Joshua Peek
c0361344d9
1.9: methods need to be coerced into strings
2008-08-29 15:43:07 -05:00
Michael Koziarski
99492bad88
Use a set for the named scope methods not a big regexp.
2008-08-29 21:12:37 +02:00
Nick Sieger
300754509b
Minor tweak to retrieve_connection_pool -- recurse instead of loop
2008-08-29 14:12:13 -05:00
Nick Sieger
113cc4e1c4
Remove some synchronization that's probably overkill, assuming one doesn't establish connections frequently
2008-08-29 14:12:13 -05:00
Nick Sieger
8e5e02bdad
Collapse connection pool class hierarchy; YAGNI.
...
- Add connection checkin and checkout callbacks to adapter to allow
adapter-specific customization of behavior (e.g., JRuby w/ JNDI)
2008-08-29 14:12:12 -05:00
Nick Sieger
d07a6b1a4a
Make clear_active_connections! also return stale connections back to the pool
...
- also clean up some cruft remaining from per-thread connection cache
2008-08-29 14:12:12 -05:00
Nick Sieger
212134dce1
Remove CachedConnectionPerThread per-thread pooling mechanism in favor of a fixed pool with default maximum of 5 connections
2008-08-29 14:12:12 -05:00
Nick Sieger
ca6d71753f
Deprecate allow_concurrency and make it have no effect
2008-08-29 14:12:12 -05:00
Nick Sieger
a96b7d4c33
Add connection reset and verification upon each connection checkout
2008-08-29 14:12:12 -05:00
Nick Sieger
d7d2d73d88
Fix typo: was using brackets instead of parens. Must need more sleep.
2008-08-29 14:12:11 -05:00
Nick Sieger
1712e37c90
Favor existing connections over new ones if available
2008-08-29 14:12:11 -05:00