Commit Graph

378 Commits

Author SHA1 Message Date
Jeremy Kemper
397c8ee2a9 r1608@asus: jeremy | 2005-07-03 00:13:57 -0700
quoter required for column quoting


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1626 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-03 08:32:12 +00:00
Jeremy Kemper
b02776c232 r1607@asus: jeremy | 2005-07-02 23:36:52 -0700
Rollback MysqlAdapter#select speedup; fix add_limit_offset


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1625 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-03 08:32:07 +00:00
Jeremy Kemper
018e12da31 r1605@asus: jeremy | 2005-07-02 14:50:23 -0700
And take it out again.. passing around the quoter doesn't make sense any more because we're calling quote_column_name, not the generic quote method.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1624 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-03 08:32:02 +00:00
Jeremy Kemper
121b15bfc9 r1604@asus: jeremy | 2005-07-02 14:40:20 -0700
Bring the column_quoter arg back to locking.rb.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1623 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-03 08:31:57 +00:00
Jeremy Kemper
96c60b0ec6 r1603@asus: jeremy | 2005-07-02 14:38:52 -0700
Faster MysqlAdapter#select.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1622 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-03 08:31:14 +00:00
Jeremy Kemper
a250a98a52 r1602@asus: jeremy | 2005-07-02 14:34:00 -0700
Don't pass connection to quoted_comma_pair_list


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1621 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-03 08:31:09 +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
9ac02777e7 Clarified intentions of validates_associated #870
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1602 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-02 06:59:08 +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
3dfa56ccfb Updated all references to the old find_first and find_all to use the new style #1511 [Marcel Molina]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1520 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-26 11:25:32 +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
Jeremy Kemper
c8e2cf3ed0 Pass association finder arguments through to the association class exactly as we received them. Fixes case where parent.children.find() is interpreted as Child.find([]) instead of Child.find().
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1498 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-24 20:23:38 +00:00
David Heinemeier Hansson
1d4d721782 Fixed docs #856
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1475 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-21 17:11:01 +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
0bdd44acca Make migrations work with the latest SQLite
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1458 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-21 06:00:17 +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
4f00d181d5 Document better #1057
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1452 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-18 05:18: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
c2ed453880 Fix quote_bound_value to not map Strings #1416 [htonl]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1445 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-16 10:13:37 +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
37a370d8d4 Be sure to use the @finder_sql in the has_many association's #find method, even if explicit conditions have not been given.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1412 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-13 12:03:33 +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
2c0fa32088 Do not use instantiated fixtures (in general) in tests. Also, support the use of transactional fixtures by setting the AR_TX_FIXTURES environment variable to "yes".
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1399 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-10 14:58:02 +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
Jamis Buck
b0a35b6fe9 Sort the migration files explicitly so that they are always ordered correctly.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1394 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-07 17:00:43 +00:00
David Heinemeier Hansson
7411af95db Replace the in-memory object, but dont orphan the existing one
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1393 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-07 12:48:37 +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
3022ee84cc Added note of limitation for #1279
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1347 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-05-21 18:23:35 +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
c8b4cf65df Speed up timestamping a tad #1227 [skaen]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1327 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-05-19 19:05:12 +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