Commit Graph

31 Commits

Author SHA1 Message Date
Jeremy Kemper dedb9c8483 Don't expect fixtures to be returned in the order they were inserted.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1403 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-12 02:27:19 +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
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
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 c1611a703c Updated documentation here and there
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1210 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-18 15:31:20 +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 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 f8783abf0c Made eager loading work even more
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1083 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-03 17:50:11 +00:00
David Heinemeier Hansson efb55d1cf5 Allow order, conditions, and joins in finds that include associations
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1080 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-03 12:06:23 +00:00
David Heinemeier Hansson abc895b828 Added new Base.find API and deprecated find_all, find_first. Added preliminary support for eager loading of associations
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1077 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-03 10:52:05 +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 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 a8f36e88dd Remove outdated dev-utils
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@765 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-23 14:30:24 +00:00
David Heinemeier Hansson 098fa94356 Fixed documentation snafus #575, #576, #577, #585
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@525 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-07 14:15:53 +00:00
David Heinemeier Hansson 8382e6e506 Dont call id explicitly to do reloading that way we get rid of the warnings #583 [Tim Bates]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@521 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-07 13:47:14 +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 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 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 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 d598635988 Added test_forgetting_the_load_when_foreign_key_enters_late
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@436 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-17 00:44:55 +00:00
David Heinemeier Hansson 8b82c5042d Test for #489
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@434 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-17 00:32:56 +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 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 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 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 5c50df27cf Attempted to capture #286 in a unit test, but couldnt get it to fail
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@132 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-12 18:12:57 +00:00
David Heinemeier Hansson ea759cb761 Added counter_sql option for has_many associations [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@68 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-07 12:25:01 +00:00
David Heinemeier Hansson 79e85edd71 Added reverse order of deleting fixtures, so referential keys can be maintained #247 [Tim Bates]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@38 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-01 12:25:04 +00:00
David Heinemeier Hansson db045dbbf6 Initial
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-11-24 01:04:44 +00:00