aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
Commit message (Collapse)AuthorAgeFilesLines
* The create and build methods are only available for has_one/belongs_to if an ↵David Heinemeier Hansson2005-01-251-2/+3
| | | | | | association already exist. It will not work when it's nil. Updated the documentation to reflect that. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@501 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@498 ↵David Heinemeier Hansson2005-01-241-0/+2
| | | | 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base.update_collection that can update an array of id/attribute pairs, ↵David Heinemeier Hansson2005-01-242-1/+59
| | | | | | such as the ones produced by the recent added support for automatic id-based indexing for lists of items #526 [Duane Johnson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@496 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added ActiveRecord::Base.timestamps_gmt that can be set to true to make the ↵David Heinemeier Hansson2005-01-242-7/+14
| | | | | | 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
* Added that update_all calls sanitize_sql on its updates argument, so stuff ↵David Heinemeier Hansson2005-01-243-1/+6
| | | | | | 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
* Fixed that the dynamic finders didnt treat nil as a "IS NULL" but rather "= ↵David Heinemeier Hansson2005-01-243-1/+28
| | | | | | NULL" case #515 [Demetrius] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@488 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed install.rb filesDavid Heinemeier Hansson2005-01-241-1/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@487 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added bind-named arrays for interpolating a group of ids or strings in ↵David Heinemeier Hansson2005-01-243-4/+23
| | | | | | conditions #528 [bitsweat] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@485 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added that has_and_belongs_to_many associations with additional attributes ↵David Heinemeier Hansson2005-01-244-18/+54
| | | | | | 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
* Fixed that records fetched with piggy-back attributes or through rich ↵David Heinemeier Hansson2005-01-243-2/+24
| | | | | | 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
* Added mass-assignment protection for the inheritance column -- regardless of ↵David Heinemeier Hansson2005-01-233-3/+17
| | | | | | a custom column is used or not git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@477 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that association proxies would fail === tests like PremiumSubscription ↵David Heinemeier Hansson2005-01-233-0/+11
| | | | | | === @account.subscription git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@476 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* A few missing filesDavid Heinemeier Hansson2005-01-201-0/+12
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@468 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Replaced === checks with is_a? checks #502, #82 [Marcel Molina]David Heinemeier Hansson2005-01-204-7/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@466 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that column aliases didn't work as expected with the new MySql411 ↵David Heinemeier Hansson2005-01-202-1/+3
| | | | | | driver #507 [Demetrius] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@465 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that find_all would produce invalid sql when called sequentialy #490 ↵David Heinemeier Hansson2005-01-202-1/+6
| | | | | | [Scott Baron] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@464 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Made ready for release of 0.9.4.1David Heinemeier Hansson2005-01-182-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@458 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Cleanup the proxy rollback #492David Heinemeier Hansson2005-01-181-14/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@457 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that the belongs_to and has_one proxy would fail a test like 'if ↵David Heinemeier Hansson2005-01-187-32/+81
| | | | | | 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
* Fixed that the Ruby/MySQL adapter wouldn't connect if the password was empty ↵David Heinemeier Hansson2005-01-182-1/+7
| | | | | | #503 [Pelle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@454 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Made human_attribute_name(attribute_key_name) use Inflector.humanizeDavid Heinemeier Hansson2005-01-171-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@451 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Made ready for release of 0.9.4David Heinemeier Hansson2005-01-173-2/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@439 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make sure #470 shouldnt be happeningDavid Heinemeier Hansson2005-01-171-13/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@437 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added test_forgetting_the_load_when_foreign_key_enters_lateDavid Heinemeier Hansson2005-01-171-0/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@436 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Only remember that an association was loaded if it was foundDavid Heinemeier Hansson2005-01-171-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@435 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Test for #489David Heinemeier Hansson2005-01-171-1/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@434 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* belongs_to association should always honor a present foreign key and ↵David Heinemeier Hansson2005-01-173-23/+33
| | | | | | condition interpolation should also be possible on belongs_to git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@433 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* New adventures in dependency reloadingDavid Heinemeier Hansson2005-01-161-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@429 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Removed the Ruby 1.8.2 test/unit fix as it didnt work anywayDavid Heinemeier Hansson2005-01-151-2/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@423 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that unit tests for MySQL are now run as the "rails" user instead of ↵David Heinemeier Hansson2005-01-152-2/+4
| | | | | | root #455 [Eric Hodel] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@419 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added validates_associated that enables validation of objects in an unsaved ↵David Heinemeier Hansson2005-01-153-0/+63
| | | | | | association #398 [Tim Bates] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@418 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added support for associating unsaved objects #402 [Tim Bates]David Heinemeier Hansson2005-01-1515-307/+800
| | | | | | | | | 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
* Added a bit more documentation on how to use the instance methods for ↵David Heinemeier Hansson2005-01-151-11/+14
| | | | | | acts_as_list #478 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@411 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed binary support for PostgreSQL #444 [alex@byzantine.no]David Heinemeier Hansson2005-01-152-1/+31
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@410 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Removed silly change caused by inability to grok own code at 3 amDavid Heinemeier Hansson2005-01-141-8/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@406 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Changed add_to_list_top and add_to_list_bottom to be publicDavid Heinemeier Hansson2005-01-141-10/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@405 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactored ActiveRecord::Base#clone to use Base#attributes #463 [atyp]David Heinemeier Hansson2005-01-131-11/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@401 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove length alias of sizeDavid Heinemeier Hansson2005-01-111-2/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@396 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added a differenciation between AssociationCollection#size and -length. Now ↵David Heinemeier Hansson2005-01-112-1/+15
| | | | | | 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
* Fixed the 4.11 changes to the mysql adapterDavid Heinemeier Hansson2005-01-112-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@391 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@388 ↵David Heinemeier Hansson2005-01-112-0/+6
| | | | 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base#attributes that returns a hash of all the attributes with their ↵David Heinemeier Hansson2005-01-113-1/+20
| | | | | | 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
* Fixed that foreign keys named the same as the association would cause stack ↵David Heinemeier Hansson2005-01-118-4/+36
| | | | | | overflow #437 [Eric Anderson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@382 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed default scope of acts_as_list from "1" to "1 = 1", so itll work in ↵David Heinemeier Hansson2005-01-112-1/+3
| | | | | | PostgreSQL (among other places) #427 [Alexey] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@380 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base#reload that reloads the attributes of an object from the database ↵David Heinemeier Hansson2005-01-103-2/+20
| | | | | | #422 [Andreas Schwarz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@376 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added SQLite3 compatibility through the sqlite3-ruby adapter by Jamis Buck ↵David Heinemeier Hansson2005-01-107-86/+153
| | | | | | #381 [bitsweat] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@374 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added support for the new protocol spoken by MySQL 4.1.1+ servers for the ↵David Heinemeier Hansson2005-01-103-0/+321
| | | | | | 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
* Some missing docsDavid Heinemeier Hansson2005-01-101-0/+12
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@369 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added that Observers can use the observes class method instead of ↵David Heinemeier Hansson2005-01-101-1/+5
| | | | | | overwriting self.observed_class() git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@367 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added time unit extensions to Fixnum that'll return the period in seconds, ↵David Heinemeier Hansson2005-01-101-0/+1
| | | | | | like 2.days + 4.hours git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@365 5ecf4fe2-1ee6-0310-87b1-e25e094e27de