aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* The has_many create method works with polymorphic associations. Closes #6361.Jeremy Kemper2006-10-081-4/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5230 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* callbacks that return false should cause save to return falseJamis Buck2006-10-041-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5226 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* MySQL: introduce Mysql::Result#all_hashes to support further optimization. ↵Jeremy Kemper2006-10-021-10/+41
| | | | | | Closes #5581. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5219 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* save! shouldn't validate twice. Closes #6324.Jeremy Kemper2006-10-021-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5215 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Association collections have an _ids reader method to match the existing ↵Jeremy Kemper2006-10-011-1/+6
| | | | | | writer for collection_select convenience (e.g. employee.task_ids). The writer method skips blank ids so you can safely do @employee.task_ids = params[:tasks] without checking every time for an empty list or blank values. References #1887, Closes #5780. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5214 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add an attribute reader method for ActiveRecord::Base.observers [Rick Olson]Rick Olson2006-09-301-0/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5211 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use class name as XML_TYPE_NAMES key.Jeremy Kemper2006-09-291-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5210 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Include caller of deprecated count method.Jeremy Kemper2006-09-291-2/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5204 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation: count class method should be called with an options hash rather ↵Jeremy Kemper2006-09-262-15/+24
| | | | | | than two args for conditions and joins. Closes #6287. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5192 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* has_one associations with a nil target may be safely marshaled. Closes #6279.Jeremy Kemper2006-09-261-0/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5188 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Duplicate the hash provided to AR::Base#to_xml to prevent unexpected side ↵Michael Koziarski2006-09-241-1/+1
| | | | | | effects [Koz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5170 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add a :namespace option to AR::Base#to_xml [Koz]Michael Koziarski2006-09-171-2/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5130 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Version updates and missing licensesDavid Heinemeier Hansson2006-09-151-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5120 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation tests. Remove warnings for dynamic finders and for the foo_count ↵Jeremy Kemper2006-09-155-29/+51
| | | | | | ethod if it's also an attribute. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5116 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Improve yaml fixtures error reporting. Closes #6205.Jeremy Kemper2006-09-131-13/+16
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5104 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* We cant make MySQL 5 happy if it means making SQLite and PostgreSQL cry. So ↵David Heinemeier Hansson2006-09-082-2/+2
| | | | | | currently MySQL 5 is not fully supported for Rails when youre using eager loading (closes #6133, #6135). I have contacted MySQL to make them fix http://bugs.mysql.com/bug.php?id=13551 [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5075 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added parentheses around FROM clauses generated by Base and associations ↵David Heinemeier Hansson2006-09-082-2/+2
| | | | | | since MySQL 5 claim that to be the standard (and will screw up joins if its not there), see http://bugs.mysql.com/bug.php?id=13551 [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5073 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Rollback [4917]. Closes #785.Jeremy Kemper2006-09-071-2/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5067 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Backed out of new_record? to new? transformation as it would screw up ↵David Heinemeier Hansson2006-09-0514-64/+65
| | | | | | existing models that did boolean calls on "new" attributes [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5018 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecated ActiveRecord::Base.new_record? in favor of ↵David Heinemeier Hansson2006-09-0514-65/+64
| | | | | | ActiveRecord::Base.new? (old version still works until Rails 2.0) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5017 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Rename quote to quote_value so the name can be used in AR models. #3628 [Koz]Michael Koziarski2006-09-047-22/+35
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5007 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add deprecation warning for inferred foreign key. #6029 [Josh Susser]Rick Olson2006-09-041-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4992 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed the Ruby/MySQL adapter we ship with Active Record to work with the new ↵David Heinemeier Hansson2006-09-041-5/+20
| | | | | | authentication handshake that was introduced in MySQL 4.1, along with the other protocol changes made at that time (closes #5723) [jimw@mysql.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4990 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation: use :dependent => :delete_all rather than ↵Jeremy Kemper2006-09-041-1/+1
| | | | | | :exclusively_dependent => true. Closes #6024. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4981 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document validates_presences_of behavior with booleans: you probably want ↵Jeremy Kemper2006-09-041-0/+4
| | | | | | validates_inclusion_of :attr, :in => [true, false]. Closes #2253. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4980 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Optimistic locking: gracefully handle nil versions, treat as zero. Closes #5908.Jeremy Kemper2006-09-041-0/+17
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4958 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Update copyright timesDavid Heinemeier Hansson2006-09-031-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4922 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* validates_confirmation_of only kicks in when the attribute, rather than its ↵Jeremy Kemper2006-09-031-1/+2
| | | | | | confirmation, is present. Closes #785. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4917 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* to_xml: the :methods option works on arrays of records. Closes #5845.Jeremy Kemper2006-09-021-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation: update docs. Closes #5998.Jeremy Kemper2006-09-011-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4898 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* has_many :through conditions are sanitized by the associating class. Closes ↵Jeremy Kemper2006-09-012-3/+3
| | | | | | #5971. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4893 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix spurious newlines and spaces in AR::Base#to_xml outputJamis Buck2006-08-301-14/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4862 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* has_one supports the :dependent => :delete option which skips the typical ↵Jeremy Kemper2006-08-291-3/+6
| | | | | | callback chain and deletes the associated object directly from the database. Closes #5927. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4848 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Nested subclasses are not prefixed with the parent class' table_name since ↵Jeremy Kemper2006-08-251-7/+16
| | | | | | they should always use the base class' table_name. Closes #5911. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4819 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* SQLServer: work around bug where some unambiguous date formats are not ↵Jeremy Kemper2006-08-251-1/+2
| | | | | | correctly identified if the session language is set to german. Closes #5894. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4816 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Clashing type columns due to a sloppy join shouldn't wreck single-table ↵Jeremy Kemper2006-08-241-11/+22
| | | | | | inheritance. Closes #5838. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4813 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixtures: correct escaping of \n and \r. Closes #5859.Jeremy Kemper2006-08-241-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4811 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Migrations: gracefully handle missing migration files. Closes #5857.Jeremy Kemper2006-08-231-1/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4809 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Rollback #5819 since it's compatible with PostgreSQL 8.1 only. References #5819.Jeremy Kemper2006-08-221-1/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4806 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* to_xml: correct naming of included associations. Closes #5831.Jeremy Kemper2006-08-201-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4794 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Pushing a record onto a has_many :through sets the association's foreign key ↵Jeremy Kemper2006-08-201-1/+2
| | | | | | to the associate's primary key and adds it to the correct association. Closes #5829. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4792 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* unbraindeadify addition to has_many :throughJeremy Kemper2006-08-193-9/+17
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4791 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Pushing a record onto a has_many :through sets the association's foreign key ↵Jeremy Kemper2006-08-191-5/+13
| | | | | | to the associate's primary key. Closes #5815. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4790 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* whitespaceJeremy Kemper2006-08-191-2/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4789 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* PostgreSQL: simplify index introspection query. Closes #5819.Jeremy Kemper2006-08-191-5/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4788 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add records to has_many :through using <<, push, and concat by creating the ↵Jeremy Kemper2006-08-182-29/+75
| | | | | | association record. Raise if base or associate are new records since both ids are required to create the association. #build raises since you can't associate an unsaved record. #create! takes an attributes hash and creates the associated record and its association in a transaction. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4786 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Cache nil results for :included has_one associations also. Closes #5787.Jeremy Kemper2006-08-171-3/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4783 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Included associations: go deep.Jeremy Kemper2006-08-161-13/+9
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4776 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed a bug which would cause .save to fail after trying to access a empty ↵Tobias Lütke2006-08-161-10/+9
| | | | | | has_one association on a unsaved record. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4773 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Nested classes are given table names prefixed by the singular form of the ↵Jeremy Kemper2006-08-161-6/+20
| | | | | | parent's table name. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4770 5ecf4fe2-1ee6-0310-87b1-e25e094e27de