Commit Graph

403 Commits

Author SHA1 Message Date
David Heinemeier Hansson
ea8f3f0a37 Added migration support for SQLite (using temporary tables to simulate ALTER TABLE) #1771 [Sam Stephenson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1893 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-22 19:58:03 +00:00
Nicholas Seckar
2cdc2a0d30 Remove extra definition of supports_migrations? from abstract_adaptor.rb
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1892 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-22 16:52:59 +00:00
Jamis Buck
d886ad5c8b Fix acts_as_list such that moving next-to-last item to the bottom does not result in duplicate positions
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1872 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-20 12:47:55 +00:00
David Heinemeier Hansson
9870396ed1 Fixed incompatibility in DB2 adapter with the new limit/offset approach #1718 [Maik Schmidt]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1850 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-17 09:52:00 +00:00
David Heinemeier Hansson
6f05696ceb Added :select option to find which can specify a different value than the default *, like find(:all, :select => "first_name, last_name"), if you either only want to select part of the columns or exclude columns otherwise included from a join #1338 [Stefan Kaes]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1830 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-14 07:18:26 +00:00
David Heinemeier Hansson
4259199c2c Made ready for release of 0.13.1
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1814 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-11 07:36:18 +00:00
David Heinemeier Hansson
5b9b904f14 Added support for limit and offset with eager loading of has_one and belongs_to associations. Using the options with has_many and has_and_belongs_to_many associations will now raise an ActiveRecord::ConfigurationError #1692 [Rick Olsen]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1811 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-11 06:09:08 +00:00
David Heinemeier Hansson
c0f84b117c Fixed that assume_bottom_position (in acts_as_list) could be called on items already last in the list and they would move one position away from the list #1648 [tyler@kianta.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1796 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-10 05:31:29 +00:00
David Heinemeier Hansson
60499774c2 Fixed that each request with the WEBrick adapter would open a new database connection #1685 [Sam Stephenson]. Added ActiveRecord::Base.threaded_connections flag to turn off 1-connection per thread (required for thread safety). By default it's on, but WEBrick in Rails need it off #1685 [Sam Stephenson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1792 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-10 04:54:34 +00:00
Jeremy Kemper
e008bfd2d8 r2985@asus: jeremy | 2005-07-10 02:04:41 -0700
Updated changelog for #1688.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1791 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-10 04:25:39 +00:00
David Heinemeier Hansson
c20713834a Fixed optimistic locking with SQL Server #1660 [tom@popdog.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1784 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-09 17:02:32 +00:00
David Heinemeier Hansson
47a3bafe26 Added a VERSION parameter to the migrate task that allows you to do "rake migrate VERSION=34" to migrate to the 34th version traveling up or down depending on the current version. Added ActiveRecord::Migrator.migrate that can figure out whether to go up or down based on the target version and the current
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1780 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-09 15:46:29 +00:00
David Heinemeier Hansson
2c8ebe4684 Added better error message for "packets out of order" #1630 [courtenay]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1774 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-08 19:22:37 +00:00
David Heinemeier Hansson
bd832a221b Fixed first run of "rake migrate" on PostgreSQL by not expecting a return value on the id #1640
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1755 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-07 08:48:59 +00:00
David Heinemeier Hansson
169eb781f1 Fixed that Yaml error message in fixtures hid the real error #1623 [Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1734 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-06 10:16:38 +00:00
David Heinemeier Hansson
17f7f8a091 Made documentation ready for release (AR)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1733 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-06 10:14:58 +00:00
David Heinemeier Hansson
977b4be208 Changed logging of SQL statements to use the DEBUG level instead of INFO. Added logging of the request URI in the benchmark statement (makes it easy to grep for slow actions). Changed the default logging level in config/environment.rb to INFO for production (so SQL statements won't be logged)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1714 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-05 17:23:41 +00:00
David Heinemeier Hansson
4160b518a8 Added new Migrations framework for describing schema transformations in a way that can be easily applied across multiple databases #1604 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1672 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-04 18:51:02 +00:00
David Heinemeier Hansson
4180e57b70 Added callback hooks to association collections #1549 [Florian Weber]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1653 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-04 08:43:57 +00:00
David Heinemeier Hansson
55692003d4 Fixed Base.content_columns call for SQL Server adapter #1450 [DeLynn Berry] And a bug with the offset rules
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1647 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-03 12:34:22 +00:00
David Heinemeier Hansson
aaa5637249 Fixed Base#write_attribute to work with both symbols and strings #1190 [Paul Legato]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1643 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-03 09:51:24 +00:00
Jeremy Kemper
e24e2c41c2 Mark ticket # in changelog. Snip some trailing whitespace.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1642 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-03 09:04:52 +00:00
David Heinemeier Hansson
df95128e94 Fixed that has_and_belongs_to_many didn't respect single table inheritance types #1081 [Florian Weber]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1641 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-03 08:52:59 +00:00
Jeremy Kemper
9ebe33f14b r1601@asus: jeremy | 2005-07-02 14:33:08 -0700
Only notify observers of after_find and after_initialize if these methods are defined on the model.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1620 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-03 08:27:18 +00:00
David Heinemeier Hansson
d9d22c7596 Fixed that single-table inheritance sub-classes couldn't be used to limit the result set with eager loading #1215 [Chris McGrath]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1619 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-03 08:21:22 +00:00
David Heinemeier Hansson
20d27f6b74 Fixed validates_numericality_of to work with overrided getter-method when :allow_nil is on #1316 [raidel@onemail.at]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1603 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-02 07:52:29 +00:00
David Heinemeier Hansson
ebd7bf7945 Added roots, root, and siblings to the batch of methods added by acts_as_tree #1541 [michael@schuerig.de]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1585 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-01 18:33:38 +00:00
David Heinemeier Hansson
f2a29ca43c Added support for ODBC connections to MS SQL Server so you can connect from a non-Windows machine #1569 [Mark Imbriaco/DeLynn Berry] Added support for limit/offset with the MS SQL Server driver so that pagination will now work #1569 [DeLynn Berry]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1583 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-01 17:20:04 +00:00
David Heinemeier Hansson
c92ecb82b8 Fixed that multiparameter posts ignored attr_protected #1532 [alec+rails@veryclever.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1550 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-28 17:15:01 +00:00
David Heinemeier Hansson
1bb676b6c0 Fixed problem with eager loading when using a has_and_belongs_to_many association using :association_foreign_key #1504 [flash@vanklinkenbergsoftware.nl]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1516 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-26 04:49:52 +00:00
David Heinemeier Hansson
302c23d5a6 Fixed Base#find to honor the documentation on how :joins work and make them consistent with Base#count #1405 [pritchie@gmail.com] Improved dynamic finder docs #1495 [laurel@gorgorg.org]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-25 11:47:37 +00:00
David Heinemeier Hansson
3eed3272d7 Fixed that validations didn't respecting custom setting for too_short, too_long messages #1437 [Marcel Molina]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1509 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-25 11:24:43 +00:00
David Heinemeier Hansson
deda0ee4a8 Fixed that clear_association_cache doesn't delete new associations on new records (so you can safely place new records in the session with Action Pack without having new associations wiped) #1494 [cluon]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-25 10:56:20 +00:00
David Heinemeier Hansson
a9fd639adf Fixed that calling Model.find([]) returns [] and doesn't throw an exception #1379
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1471 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-21 16:36:18 +00:00
Jamis Buck
361be5a7dd Removed the AR::Recursion module--it broke more code than it fixed
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1470 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-21 12:58:27 +00:00
David Heinemeier Hansson
a2f26b971b Fixed that adding a record to a has_and_belongs_to collection would always save it -- now it only saves if its a new record #1203 [Alisdair McDiarmid]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1453 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-18 05:28:59 +00:00
David Heinemeier Hansson
d808cd4582 Fixed saving of in-memory association structures to happen as a after_create/after_update callback instead of after_save -- that way you can add new associations in after_create/after_update callbacks without getting them saved twice
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1448 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-17 10:08:41 +00:00
David Heinemeier Hansson
bdf51f9582 Revealed the man behind the mask!
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1443 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-16 06:46:22 +00:00
David Heinemeier Hansson
253a2bbefb Allow any Enumerable, not just Array, to work as bind variables #1344 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1442 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-16 06:44:48 +00:00
David Heinemeier Hansson
bfe6a759c2 Added actual database-changing behavior to collection assigment for has_many and has_and_belongs_to_many #1425 [Sebastian Kanthak]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1428 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-16 05:35:10 +00:00
Jeremy Kemper
1d9905a67f r1307@iwill: jeremy | 2005-06-13 19:05:00 -0700
Ticket 1312 - Malformed habtm finder sql
 r1308@iwill:  jeremy | 2005-06-13 19:58:48 -0700
 Add a habtm with an unquoted condition to Project.
 r1309@iwill:  jeremy | 2005-06-13 19:59:46 -0700
 Space out habtm finder conditions.
 r1310@iwill:  jeremy | 2005-06-13 20:00:16 -0700
 Test habtm.find with quoted and unquoted conditions.
 r1311@iwill:  jeremy | 2005-06-13 20:00:25 -0700
 Update changelog


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1414 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-13 21:51:43 +00:00
Jamis Buck
e0537acaeb Added ActiveRecord::Recursion to guard against recursive calls to #save
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1411 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-13 10:52:53 +00:00
Jeremy Kemper
76e4c1a558 r1294@iwill: jeremy | 2005-06-13 02:17:42 -0700
Ticket #1281
 r1295@iwill:  jeremy | 2005-06-13 02:50:50 -0700
 Apply patch, tweak, and test.
 r1296@iwill:  jeremy | 2005-06-13 02:51:04 -0700
 Changelog entry.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1410 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-13 04:42:36 +00:00
Jeremy Kemper
1fde44bfee r1278@iwill: jeremy | 2005-06-12 05:11:48 -0700
Branch for PostgreSQL schema.  Ticket #827.
 r1281@iwill:  jeremy | 2005-06-12 19:06:43 -0700
 remove search_path from PostgreSQL db definition
 r1282@iwill:  jeremy | 2005-06-12 19:07:50 -0700
 Rakefile support for database-specific tests.
 r1283@iwill:  jeremy | 2005-06-12 19:10:18 -0700
 Add schema_search_path attribute to PostgreSQL adapter.  Replace table_structure with column_definitions which finds the given table_name in the schema search path.
 r1284@iwill:  jeremy | 2005-06-12 19:12:10 -0700
 Unit test PostgreSQL schema search path.
 r1285@iwill:  jeremy | 2005-06-12 19:12:20 -0700
 Changelog entry.
 r1286@iwill:  jeremy | 2005-06-12 20:08:20 -0700
 Don't try to quote schema names.  Include a reference to the PostgreSQL schema docs.
 r1287@iwill:  jeremy | 2005-06-12 20:16:07 -0700
 SchemasTest -> SchemaTest


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1407 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-12 22:05:30 +00:00
Jeremy Kemper
c4a3634929 Corrected @@configurations typo. #1410 [david@ruppconsulting.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1406 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-12 13:32:06 +00:00
Jeremy Kemper
d0bd3b5af4 Return PostgreSQL columns in the order they are declared #1374 (perlguy@gmail.com). Unit test column order, adapter housekeeping, simplify users of columns_hash.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1405 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-12 06:56:51 +00:00
Jamis Buck
d79838fdcb Allow before/after update hooks to work on models with optimistic locking
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1400 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-11 10:06:47 +00:00
Jamis Buck
7f9ffb2ebf Eager loading of dependent has_one associations won't delete the association #1212. Also, starting to refactor the tests to make them speedier, with optional support for transactional fixtures.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1398 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-10 13:54:58 +00:00
David Heinemeier Hansson
2bdaff4a4e Added a second parameter to the build and create method for has_one that controls whether the existing association should be replaced (which means nullifying its foreign key as well). By default this is true, but false can be passed to prevent it.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1392 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-06 21:10:59 +00:00
Jamis Buck
ba254b5494 Using transactional fixtures now causes the data to be loaded only once, for BIG speed improvements
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1384 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-03 16:06:38 +00:00
Jamis Buck
6d9ee4a306 Added fixture accessors that can be used when fixture instantiation is disabled, "model_name(:fixture_name)"
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1383 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-03 11:49:34 +00:00
David Heinemeier Hansson
dab360e181 Added DoubleRenderError exception that'll be raised if render* is called twice #518 [Nicholas Seckar]. Fixed exceptions occuring after render has been called #1096 [Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1348 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-05-21 18:51:08 +00:00
David Heinemeier Hansson
a1e9ceebd5 Added Errors#add_on_blank which works like Errors#add_on_empty, but uses Object#blank? instead. CHANGED: validates_presence_of now uses Errors#add_on_blank, which will make " " fail the validation where it didnt before #1309. Added that " " is now also blank? (using strip if available)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1346 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-05-21 18:12:36 +00:00
David Heinemeier Hansson
10eb22cdce Added the :if option to all validations that can either use a block or a method pointer to determine whether the validation should be run or not. #1324 [Duane Johnson/jhosteny]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1340 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-05-21 10:57:18 +00:00
David Heinemeier Hansson
47dcc5ffc6 Fixed use of construct_finder_sql when using :join #1288 [dwlt@dwlt.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1316 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-05-19 17:23:28 +00:00
David Heinemeier Hansson
190e04645b Fixed that :delete_sql in has_and_belongs_to_many associations couldn't access record properties #1299 [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1313 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-05-19 17:07:56 +00:00
David Heinemeier Hansson
6ea6a725c4 Push to .org instead
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1310 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-05-19 16:42:47 +00:00
David Heinemeier Hansson
c8bd316754 Changed that destroying an object will only freeze the attributes hash, which keeps the object from having attributes changed (as that wouldn't make sense), but allows for the querying of associations after it has been destroyed.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1274 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-05-02 16:48:07 +00:00
David Heinemeier Hansson
24a9050b6e Changed the callbacks such that observers are notified before the in-object callbacks are triggered. Without this change, it wasn't possible to act on the whole object in something like a before_destroy observer without having the objects own callbacks (like deleting associations) called first.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1273 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-05-02 16:46:30 +00:00
David Heinemeier Hansson
5f77f64e92 Added option for passing an array to the find_all version of the dynamic finders and have it evaluated as an IN fragment
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1266 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-05-02 05:34:27 +00:00
David Heinemeier Hansson
2bf223051e Added compatibility with camelCase column names for dynamic finders #533 [Dee.Zsombor]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1263 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-30 15:49:28 +00:00
David Heinemeier Hansson
eefe4d0ddd Fixed extraneous comma in count() function that made it not work with joins #1156 [jarkko/Dee.Zsombor]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1262 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-30 15:45:15 +00:00
David Heinemeier Hansson
787951348b Fixed incompatibility with Base#find with an array of ids that would fail when using eager loading #1186 [Alisdair McDiarmid]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1259 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-30 14:04:01 +00:00
David Heinemeier Hansson
9f1b57779f Fixed that validate_length_of lost :on option when :within was specified #1195 [jhosteny@mac.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1258 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-30 14:02:03 +00:00
David Heinemeier Hansson
9ede45f60f Added encoding and min_messages options for PostgreSQL #1205 [shugo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1255 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-30 13:21:47 +00:00
David Heinemeier Hansson
b09fde1924 Fixed acts_as_list where deleting an item that was removed from the list would ruin the positioning of other list items #1197 [Jamis Buck]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1237 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-25 16:11:31 +00:00
David Heinemeier Hansson
d8fc381ebc Added validates_exclusion_of as a negative of validates_inclusion_of
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1236 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-24 16:25:57 +00:00
David Heinemeier Hansson
83a531ed5b Fixed frivilous database queries being triggered with eager loading on empty associations and other things
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1232 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-19 17:05:54 +00:00
David Heinemeier Hansson
6f34400086 Fixed order of loading in eager associations
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1229 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-19 16:32:57 +00:00
David Heinemeier Hansson
cdf88b7b04 Fixed stray comma when using eager loading and ordering together from has_many associations #1143
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1220 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-19 05:24:50 +00:00
David Heinemeier Hansson
7d01005514 Fixed documentation and prepared for release of 0.12
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1216 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-18 20:10:11 +00:00
David Heinemeier Hansson
f46486d37e Added Base.save! that attempts to save the record just like Base.save but will raise a InvalidRecord exception instead of returning false if the record is not valid [After much pestering from Dave Thomas]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1215 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-18 19:19:23 +00:00
David Heinemeier Hansson
515886a565 Added documentation for new Base.find API and eager association loading
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1209 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-18 14:39:36 +00:00
David Heinemeier Hansson
c35ad2d508 Fixed PostgreSQL usage of fixtures with regards to public schemas and table names with dots #962 [gnuman1@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1206 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-18 08:11:15 +00:00
David Heinemeier Hansson
03097d3a60 Fixed that fixtures were being deleted in the same order as inserts causing FK errors #890 [andrew.john.peters@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1205 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-18 07:52:58 +00:00
David Heinemeier Hansson
1a6954af01 Changed habtm eager loading to also use joins
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1201 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-18 05:55:20 +00:00
David Heinemeier Hansson
0591c53efd Made the dynamic finders use the new find API and updated the examples here and there
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1196 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-17 17:16:24 +00:00
David Heinemeier Hansson
7ff635c8eb Fixes a problem with the SQL Adapter which was resulting in IDENTITY_INSERT not being set to ON when it should be #1104 [adelle]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1192 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-17 13:59:02 +00:00
David Heinemeier Hansson
d5b67ed8d3 Added the option to specify the acceptance string in validates_acceptance_of #1106 [caleb@aei-tech.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1188 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-17 10:04:07 +00:00
David Heinemeier Hansson
339f4956b3 Added acts_as_nested_set #1000 [wschenk]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1185 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-17 09:52:12 +00:00
David Heinemeier Hansson
ed46cc3058 Added insert_at(position) to acts_as_list #1083 [DeLynnB]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1179 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-17 06:50:17 +00:00
David Heinemeier Hansson
71bdf13b60 Removed the default order by id on has_and_belongs_to_many queries as it could kill performance on large sets (you can still specify by hand with :order)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1162 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-13 17:51:43 +00:00
David Heinemeier Hansson
908e9a17d8 Fixed that Base.silence should restore the old logger level when done, not just set it to DEBUG #1084 [yon@milliped.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1155 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-13 05:16:52 +00:00
David Heinemeier Hansson
5fe0ecce0a Fixed boolean saving on Oracle #1093 [mparrish@pearware.org]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1150 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-13 04:46:59 +00:00
David Heinemeier Hansson
3b9e90a4da Moved build_association and create_association for has_one and belongs_to out of deprecation as they work when the association is nil unlike association.build and association.create, which require the association to be already in place #864
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1146 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-12 05:34:10 +00:00
David Heinemeier Hansson
a677da209b Added rollbacks of transactions if they're active as the dispatcher is killed gracefully (TERM signal) #1054 [Leon Bredt]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1136 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-10 17:34:29 +00:00
David Heinemeier Hansson
7ad57c4f02 Added quoting of column names for fixtures #997 [jcfischer@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1110 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-07 06:54:25 +00:00
David Heinemeier Hansson
7b37c779d8 Fixed counter_sql when no records exist in database for PostgreSQL (would give error, not 0) #1039 [Caleb Tennis]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1104 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-07 06:29:31 +00:00
David Heinemeier Hansson
91834e0c3f Fixed that benchmarking times for rendering included db runtimes #987 [skaes@web.de]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1070 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-02 09:31:58 +00:00
David Heinemeier Hansson
5b36c9275d Fixed boolean queries for t/f fields in PostgreSQL #995 [dave@cherryville.org]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1066 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-02 08:58:43 +00:00
David Heinemeier Hansson
1ba1779754 Added that model.items.delete(child) will delete the child, not just set the foreign key to nil, if the child is dependent on the model #978 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1064 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-02 08:52:51 +00:00
David Heinemeier Hansson
c6cc707854 Fixed auto-stamping of dates (created_on/updated_on) for PostgreSQL #985 [dave@cherryville.org]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1063 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-02 08:42:21 +00:00
David Heinemeier Hansson
aec31cd09f Fixed Base.silence/benchmark to only log if a logger has been configured #986 [skaes@web.de]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1059 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-02 08:31:26 +00:00
David Heinemeier Hansson
06a6133fff Added a join parameter as the third argument to Base.find_first and as the second to Base.count #426, #988 [skaes@web.de]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1058 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-02 08:29:54 +00:00
David Heinemeier Hansson
e130b9e017 Added a join parameter as the third argument to Base.find_first #426 [skaes@web.de]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1047 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-31 14:35:14 +00:00
David Heinemeier Hansson
cfef86c645 Fixed bug in Base#hash method that would treat records with the same string-based id as different [Dave Thomas]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1039 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-30 14:25:29 +00:00
David Heinemeier Hansson
ea3016f5d9 Renamed DateHelper#distance_of_time_in_words_to_now to DateHelper#time_ago_in_words (old method name is still available as a deprecated alias)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1038 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-30 13:06:19 +00:00
David Heinemeier Hansson
04c7e82369 Made ready for the release of 0.11.1
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1023 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-27 14:10:42 +00:00
David Heinemeier Hansson
45137795e8 Fixed that MissingSourceFile's wasn't properly detected in production mode #925 [Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@990 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-25 09:07:01 +00:00
David Heinemeier Hansson
a5c6942830 Fixed that :counter_cache option would look for a line_items_count column for a LineItem object instead of lineitems_count
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@989 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-23 23:39:18 +00:00
David Heinemeier Hansson
d09e42cfe4 Fixed that AR exists?() would explode on postgresql if the passed id did not match the PK type #900 [Scott Barron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@983 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-23 00:57:38 +00:00
David Heinemeier Hansson
f30b7a31bd Fixed the MS SQL adapter to work with the new limit/offset approach and with binary data (still suffering from 7KB limit, though) #901 [delynnb]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@982 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-23 00:56:13 +00:00
David Heinemeier Hansson
6ad1b895f4 Updated more documentation
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@975 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-22 12:41:34 +00:00
David Heinemeier Hansson
ee8d110068 Added adapter independent limit clause as a two-element array with the first being the limit, the second being the offset #795 [Sam Stephenson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@944 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-20 21:56:50 +00:00
David Heinemeier Hansson
ce23862800 Added alias_method :to_param, :id to Base, such that Active Record objects to be used as URL parameters in Action Pack automatically #812 [Nicholas Seckar/Sam Stephenson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@936 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-20 15:45:36 +00:00
David Heinemeier Hansson
1b40f051e7 Improved the performance of the OCI8 adapter for Oracle #723 [pilx/gjenkins]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@930 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-20 14:33:45 +00:00
David Heinemeier Hansson
dabf906249 Added type conversion before saving a record, so string-based values like "10.0" arent left for the database to convert #820 [dave@cherryville.org]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@928 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-20 14:25:26 +00:00
David Heinemeier Hansson
b2cfbc4cc9 Added with additional settings for working with transactional fixtures and pre-loaded test databases #865 [mindel]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@924 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-20 13:42:35 +00:00
David Heinemeier Hansson
6717ed61c1 Fixed acts_as_list to trigger remove_from_list on destroy after the fact, not before, so a unique position can be maintained #871 [Alisdair McDiarmid]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@923 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-20 13:39:15 +00:00
David Heinemeier Hansson
060b9b16aa Added the possibility of specifying fixtures in multiple calls #816 [kim@tinker.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@915 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-17 19:36:44 +00:00
David Heinemeier Hansson
2f944123f3 Added Base.exists?(id) that'll return true if an object of the class with the given id exists #854 [stian@grytoyr.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@913 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-17 14:12:25 +00:00
David Heinemeier Hansson
b55f59e811 Added optionally allow for nil or empty strings with validates_numericality_of #801 [Sebastian Kanthak] Fixed problem with using slashes in validates_format_of regular expressions #801 [Sebastian Kanthak]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@910 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-14 23:56:47 +00:00
David Heinemeier Hansson
bfa6bfc24a Fixed that SQLite3 exceptions are caught and reported properly #823 [yerejm]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-14 23:48:39 +00:00
David Heinemeier Hansson
7edb10fe68 Added that all types of after_find/after_initialized callbacks are triggered if the explicit implementation is present, not only the explicit implementation itself
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@898 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-14 00:04:14 +00:00
David Heinemeier Hansson
2bfaa05595 Fixed that symbols can be used on attribute assignment, like page.emails.create(:subject => data.subject, :body => data.body)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@886 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-10 14:44:01 +00:00
David Heinemeier Hansson
184419092a Prepared for 0.10.1 release
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@874 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-07 01:50:58 +00:00
David Heinemeier Hansson
911614df6e Added ActiveRecord::Base.colorize_logging to control whether to use colors in logs or not (on by default)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@860 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-06 17:18:34 +00:00
David Heinemeier Hansson
36a9eff957 Added support for timestamp with time zone in PostgreSQL #560 [Scott Barron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@858 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-06 14:31:38 +00:00
David Heinemeier Hansson
d2fefbe908 Added MultiparameterAssignmentErrors and AttributeAssignmentError exceptions #777 [demetrius]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@853 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-06 14:11:26 +00:00
David Heinemeier Hansson
903ef71b99 Added transactional fixtures that uses rollback to undo changes to fixtures instead of DELETE/INSERT -- it's much faster. See documentation under Fixtures #760 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@846 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-06 13:51:55 +00:00
David Heinemeier Hansson
7267db5890 Added destruction of dependent objects in has_one associations when a new assignment happens #742 [mindel]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@843 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-06 13:40:21 +00:00
David Heinemeier Hansson
838ae35d63 Added validates_numericality_of #716 [skanthak/c.r.mcgrath]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@842 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-06 12:43:23 +00:00
David Heinemeier Hansson
5e44eda787 Fixed that HasManyAssociation#count was using :finder_sql rather than :counter_sql if it was available #445 [Scott Barron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@834 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-06 11:53:49 +00:00
David Heinemeier Hansson
02ba03509c Added better defaults for composed_of, so statements like composed_of :time_zone, :mapping => %w( time_zone time_zone ) can be written without the mapping part (it's now assumed)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@821 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-01 23:52:36 +00:00
David Heinemeier Hansson
85bb292a8f Added MacroReflection#macro which will return a symbol describing the macro used (like :composed_of or :has_many) #718, #248 [james@slashetc.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@805 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-27 17:18:35 +00:00
David Heinemeier Hansson
99fca6330d Marked for release
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@796 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-24 13:16:41 +00:00
David Heinemeier Hansson
4fbc3e30eb Changed the auto-timestamping feature to use ActiveRecord::Base.default_timezone instead of entertaining the parallel ActiveRecord::Base.timestamps_gmt method. The latter is now deprecated and will throw a warning on use (but still work) #710 [Jamis Buck]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@788 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-24 12:00:42 +00:00
David Heinemeier Hansson
f9fca1eb63 Moved TimeZone to Active Support
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@768 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-23 15:13:03 +00:00
David Heinemeier Hansson
3ebe3a7814 Where to get the OCI8 driver
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@762 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-23 13:39:32 +00:00
David Heinemeier Hansson
10d458b0aa Added a OCI8-based Oracle adapter that has been verified to work with Oracle 8 and 9 #629 [Graham Jenkins]. Removed Maiks Oracle adapter until it can be merged with the OCI one.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@761 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-23 13:34:57 +00:00
David Heinemeier Hansson
6329daf5ac Added TimeZone as the first of a number of value objects that Active Record will start shipping to provide incentatives to use rich value objects using composed_of #688 [Jamis Buck]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@760 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-23 12:56:16 +00:00
David Heinemeier Hansson
d768ff1146 Documentation fix #698
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@756 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-23 12:31:05 +00:00
David Heinemeier Hansson
e9426d2264 Optimized the SQL used to generate has_and_belongs_to_many queries by listing the join table first #693 [yerejm]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@741 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-22 13:58:22 +00:00
David Heinemeier Hansson
dfd43d577e Fixed that when using validation macros with a custom message, if you happened to use single quotes in the message string you would get a parsing error #657 [tonka]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@740 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-22 13:54:26 +00:00
David Heinemeier Hansson
f384582240 Fixed that Active Record would throw Broken Pipe errors with FCGI when the MySQL connection timed out instead of reconnecting #428 [Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@729 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-21 01:44:15 +00:00
David Heinemeier Hansson
ba309a3e38 Added options to specify an SSL connection for MySQL. Define the following attributes in the connection config (config/database.yml in Rails) to use it: sslkey, sslcert, sslca, sslcapath, sslcipher. To use SSL with no client certs, just set :sslca = /dev/null. http://dev.mysql.com/doc/mysql/en/secure-connections.html #604 [daniel@nightrunner.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@720 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-20 21:47:09 +00:00
David Heinemeier Hansson
101968f367 Added automatic dropping/creating of test tables for running the unit tests on all databases #587 [adelle@bullet.net.au]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-20 21:21:41 +00:00
David Heinemeier Hansson
06b8936914 Fixed that find_by_* would fail when column names had numbers #670 [demetrius]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-19 11:30:38 +00:00
David Heinemeier Hansson
57c32677c9 Fixed the SQL Server adapter on a bunch of issues #667 [DeLynn]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@675 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-19 00:05:40 +00:00
David Heinemeier Hansson
28edbca477 Fixed that the dynamic finder like find_all_by_something_boolean(false) didn't work #649 [lmarlow@yahoo.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-18 17:16:04 +00:00
David Heinemeier Hansson
e39bf10594 Loading the Routes should happen in the environments #655
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@657 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-17 23:03:48 +00:00
David Heinemeier Hansson
0e764a5599 Addded validation for validate all the associated objects before declaring failure with validates_associated #618 [Tim Bates]. Added that validates_* now accept blocks to perform validations #618 [Tim Bates]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@650 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-17 19:14:15 +00:00
David Heinemeier Hansson
1aa82b3217 Added keyword-style approach to defining the custom relational bindings #545 [Jamis Buck]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@527 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-07 14:26:57 +00:00
David Heinemeier Hansson
336c2cbb8f Added an Oracle adapter that works with the Oracle bindings by Yoshida (http://raa.ruby-lang.org/project/oracle/) #564 [Maik Schmidt]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@522 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-07 14:06:00 +00:00
David Heinemeier Hansson
431e21cb45 Fixed Base#clone for use with PostgreSQL #565 [hanson@surgery.wisc.edu]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@519 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-07 13:43:44 +00:00
David Heinemeier Hansson
ac8ebc19be Prepared for 0.9.5 release
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@515 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-25 20:10:24 +00:00
David Heinemeier Hansson
efa81dad51 Added the option of supplying an array of ids and attributes to Base#update, so that multiple records can be updated at once (inspired by #526/Duane Johnson). Added the option of supplying an array of attributes to Base#create, so that multiple records can be created at once. Added that Base#delete and Base#destroy both can take an array of ids to delete/destroy #336. Added that has_many association build and create methods can take arrays of record data like Base#create and Base#build to build/create multiple records at once.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-25 12:45:01 +00:00
David Heinemeier Hansson
d071deeecd git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@498 5ecf4fe2-1ee6-0310-87b1-e25e094e27de 2005-01-24 14:15:18 +00:00
David Heinemeier Hansson
981d86cbb9 Added ActiveRecord::Base.timestamps_gmt that can be set to true to make the automated timestamping use GMT instead of local time #520 [Scott Baron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@491 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-24 13:18:29 +00:00
David Heinemeier Hansson
566a36966b Added that update_all calls sanitize_sql on its updates argument, so stuff like MyRecord.update_all(['time = ?', Time.now]) works #519 [notahat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@489 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-24 13:06:12 +00:00
David Heinemeier Hansson
93ec130377 Fixed that the dynamic finders didnt treat nil as a "IS NULL" but rather "= NULL" case #515 [Demetrius]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@488 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-24 13:02:50 +00:00
David Heinemeier Hansson
872ddaf290 Added bind-named arrays for interpolating a group of ids or strings in conditions #528 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@485 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-24 11:57:22 +00:00
David Heinemeier Hansson
b29c01ea89 Added that has_and_belongs_to_many associations with additional attributes also can be created between unsaved objects and only committed to the database when Base#save is called on the associator #524 [Eric Anderson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@484 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-24 11:39:23 +00:00
David Heinemeier Hansson
1d61845587 Fixed that records fetched with piggy-back attributes or through rich has_and_belongs_to_many associations couldn't be saved due to the extra attributes not part of the table #522 [Eric Anderson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@483 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-24 11:20:47 +00:00
David Heinemeier Hansson
95454bfb33 Added mass-assignment protection for the inheritance column -- regardless of a custom column is used or not
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@477 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-23 17:24:54 +00:00
David Heinemeier Hansson
97849debf3 Fixed that association proxies would fail === tests like PremiumSubscription === @account.subscription
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@476 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-23 15:19:33 +00:00
David Heinemeier Hansson
db6688585f Fixed that column aliases didn't work as expected with the new MySql411 driver #507 [Demetrius]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@465 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-20 14:36:39 +00:00
David Heinemeier Hansson
4ddbe0ac44 Fixed that find_all would produce invalid sql when called sequentialy #490 [Scott Baron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@464 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-20 14:35:00 +00:00
David Heinemeier Hansson
a5364fb3ac Made ready for release of 0.9.4.1
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@458 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-18 14:13:12 +00:00
David Heinemeier Hansson
bce0e14930 Fixed that the belongs_to and has_one proxy would fail a test like 'if project.manager' -- this unfortunately also means that you can't call methods like project.manager.build unless there already is a manager on the project #492 [Tim Bates]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@456 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-18 11:07:03 +00:00
David Heinemeier Hansson
53088c4c7f Fixed that the Ruby/MySQL adapter wouldn't connect if the password was empty #503 [Pelle]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@454 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-18 09:54:12 +00:00
David Heinemeier Hansson
ddcc400293 Made ready for release of 0.9.4
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@439 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-17 01:13:15 +00:00
David Heinemeier Hansson
bb92382424 Fixed that unit tests for MySQL are now run as the "rails" user instead of root #455 [Eric Hodel]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@419 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-15 17:54:45 +00:00
David Heinemeier Hansson
51390b8524 Added validates_associated that enables validation of objects in an unsaved association #398 [Tim Bates]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@418 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-15 17:52:08 +00:00
David Heinemeier Hansson
823554eafe Added support for associating unsaved objects #402 [Tim Bates]
Added replace to associations, so you can do project.manager.replace(new_manager) or project.milestones.replace(new_milestones) #402 [Tim Bates]
Added build and create methods to has_one and belongs_to associations, so you can now do project.manager.build(attributes) #402 [Tim Bates]
Fixed that Base#== wouldn't work for multiple references to the same unsaved object #402 [Tim Bates]
Added that if a before_* callback returns false, all the later callbacks and the associated action are cancelled. If an after_* callback returns false, all the later callbacks are cancelled. Callbacks are generally run in the order they are defined, with the exception of callbacks defined as methods on the model, which are called last. #402 [Tim Bates]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@417 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-15 17:45:16 +00:00
David Heinemeier Hansson
ad63c96ff2 Fixed binary support for PostgreSQL #444 [alex@byzantine.no]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@410 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-15 13:48:39 +00:00
David Heinemeier Hansson
fe8fb574c0 Added a differenciation between AssociationCollection#size and -length. Now AssociationCollection#size returns the size of the collection by executing a SELECT COUNT(*) query if the collection hasn't been loaded and calling collection.size if it has. If it's more likely than not that the collection does have a size larger than zero and you need to fetch that collection afterwards, it'll take one less SELECT query if you use length.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@392 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-11 13:21:17 +00:00
David Heinemeier Hansson
b067bf7884 Added Base#attributes that returns a hash of all the attributes with their names as keys and clones of their objects as values #433 [atyp.de]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@386 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-11 00:45:26 +00:00
David Heinemeier Hansson
79365a0184 Fixed that foreign keys named the same as the association would cause stack overflow #437 [Eric Anderson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@382 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-11 00:24:19 +00:00
David Heinemeier Hansson
a971dc5e4a Fixed default scope of acts_as_list from "1" to "1 = 1", so itll work in PostgreSQL (among other places) #427 [Alexey]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@380 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-11 00:13:42 +00:00
David Heinemeier Hansson
3ff5c5805f Added Base#reload that reloads the attributes of an object from the database #422 [Andreas Schwarz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@376 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-10 23:49:57 +00:00
David Heinemeier Hansson
a133f3e64f Added SQLite3 compatibility through the sqlite3-ruby adapter by Jamis Buck #381 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@374 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-10 23:09:51 +00:00
David Heinemeier Hansson
b9f28eb587 Added support for the new protocol spoken by MySQL 4.1.1+ servers for the Ruby/MySQL adapter that ships with Rails #440 [Matt Mower]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@372 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-10 22:52:14 +00:00
David Heinemeier Hansson
7ed4b745fc Some missing docs
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@369 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-10 19:18:37 +00:00
David Heinemeier Hansson
b64004fda6 Fixed that conditions in has_many and has_and_belongs_to_many should be interpolated just like the finder_sql is
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@344 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-07 03:55:24 +00:00
David Heinemeier Hansson
393e98a859 Fixed Base#update_attribute to be indifferent to whether a string or symbol is used to describe the name
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@341 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-06 02:36:33 +00:00
David Heinemeier Hansson
d1abe806c5 Added Base#toggle(attribute) and Base#toggle!(attribute) that makes it easier to flip a switch or flag. Added Base#increment!(attribute) and Base#decrement!(attribute) that also saves the records. Added Base#increment(attribute) and Base#decrement(attribute) that encapsulates the += 1 and -= 1 patterns.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@340 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-06 02:31:35 +00:00
David Heinemeier Hansson
f2e6945b25 Prepared for release of 0.9.3
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@333 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-04 12:35:10 +00:00
David Heinemeier Hansson
f8bc7a4577 Fixed that validates_uniqueness_of used 'id' instead of defined primary key #406
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@328 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-04 01:23:38 +00:00
David Heinemeier Hansson
846f0d5ab6 Fixed that the overwritten respond_to? method didn't take two parameters like the original #391
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@326 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-03 23:23:02 +00:00
David Heinemeier Hansson
609ca177fa Added HasManyAssociation#count that works like Base#count #413 [intinig]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@318 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 18:44:55 +00:00
David Heinemeier Hansson
089ef42520 Fixed handling of binary content in blobs and similar fields for Ruby/MySQL and SQLite #409 [xal]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@309 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 15:09:03 +00:00
David Heinemeier Hansson
959f362ac4 Added find_all style to the new dynamic finders
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@308 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 13:51:00 +00:00
David Heinemeier Hansson
ac8fd7dfb9 Added dynamic attribute-based finders as a cleaner way of getting objects by simple queries without turning to SQL.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@307 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 13:31:00 +00:00
David Heinemeier Hansson
6bd672eb0d Added that Base#find takes an optional options hash, including :conditions. Base#find_on_conditions deprecated in favor of #find with :conditions #407 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@305 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 19:50:23 +00:00
David Heinemeier Hansson
daf3e92a31 Added a db2 adapter that only depends on the Ruby/DB2 bindings (http://raa.ruby-lang.org/project/ruby-db2/) #386 [Maik Schmidt]. Converted all the fixtures to YAML style ones.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@303 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 19:22:16 +00:00
David Heinemeier Hansson
a6fefad354 Added the final touches to the Microsoft SQL Server adapter by DeLynn Berry that makes it suitable for actual use #394 [DeLynn Barry]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@302 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 18:55:04 +00:00
David Heinemeier Hansson
3e0077f54d Fixed a bug in the Ruby/MySQL that caused binary content to be escaped badly and come back mangled #405 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@301 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 18:34:39 +00:00
David Heinemeier Hansson
7ad83b8df2 Added block-style for callbacks #332 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@296 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 16:14:15 +00:00
David Heinemeier Hansson
fbf9281f0e Added automated optimistic locking if the field lock_version is present #384 [Michael Koziarski]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@295 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-31 19:38:04 +00:00
David Heinemeier Hansson
f0a3397c47 Added :counter_cache option to acts_as_tree that works just like the one you can define on belongs_to #371 [Josh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@291 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-31 16:53:41 +00:00
David Heinemeier Hansson
256d387159 Fixed quoting in validates_format_of that would allow some rules to pass regardless of input #390 [Dmitry V. Sabanin]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@288 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-31 16:42:25 +00:00
David Heinemeier Hansson
13273f7a55 Fixed broken transactions that were actually only running object-level and not db level transactions [andreas]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@286 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-30 14:52:42 +00:00
David Heinemeier Hansson
60de8c1108 Added Base.default_timezone accessor that determines whether to use Time.local (using :local) or Time.utc (using :utc) when pulling dates and times from the database. This is set to :local by default.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@271 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-28 17:30:17 +00:00
David Heinemeier Hansson
8a9b998b79 Fixed that the const_missing autoload assumes the requested constant is set by require_association and calls const_get to retrieve it. If require_association did not set the constant then const_get will call const_missing, resulting in an infinite loop #380 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@270 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-28 16:27:08 +00:00
David Heinemeier Hansson
d9c0a37f37 Releasing Rails 0.9.2
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@260 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 23:56:17 +00:00
David Heinemeier Hansson
ab4c640b96 Added scope option to validation_uniqueness #349 [Kent Sibilev]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@259 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 23:40:44 +00:00
David Heinemeier Hansson
d834b65b54 Added allow_nil options to validates_inclusion_of so that validation is only triggered if the attribute is not nil [what-a-day]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@258 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 23:25:45 +00:00
David Heinemeier Hansson
2ec81dcd28 Added work-around for PostgreSQL and the problem of getting fixtures to be created from id 1 on each test case. This only works for auto-incrementing primary keys called "id" for now #359 [Scott Baron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@257 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 23:09:30 +00:00
David Heinemeier Hansson
4b229d1034 Added Base#clear_association_cache to empty all the cached associations #347 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@252 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 13:54:44 +00:00