aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
Commit message (Collapse)AuthorAgeFilesLines
* Subclasses of an abstract class work with single-table inheritance. Closes ↵Jeremy Kemper2006-12-014-8/+62
| | | | | | #5704. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Quote ActiveSupport::Multibyte::Chars. Closes #6653.Jeremy Kemper2006-11-201-0/+12
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5597 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Test for forged '' default before it's typecast. Closes #6156.Jeremy Kemper2006-11-201-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5596 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Test has_one :dependent => :nullify with missing association. Closes #4828.Jeremy Kemper2006-11-201-0/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5594 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Simplify query_attribute by typecasting the attribute value and checking ↵Jeremy Kemper2006-11-201-1/+28
| | | | | | whether it's nil, false, zero or blank. Closes #6659. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5593 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* validates_numericality_of uses \A \Z to ensure the entire string matches ↵Jeremy Kemper2006-11-201-12/+19
| | | | | | rather than ^ $ which may match one valid line of a multiline string. Closes #5716. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5589 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Run validations in the order they were declared. Closes #6657.Jeremy Kemper2006-11-201-7/+16
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5588 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* MySQL: detect when a NOT NULL column without a default value is misreported ↵Jeremy Kemper2006-11-202-4/+20
| | | | | | as default ''. Can't detect for string, text, and binary columns since '' is a legitimate default. Closes #6156. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5586 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Cleanup SQLite AUTOINCREMENT: exclude sqlite_sequence table, factor out ↵Jeremy Kemper2006-11-142-1/+12
| | | | | | feature availability check. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5520 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Oracle: automatically detect the primary key. Closes #6594.Jeremy Kemper2006-11-131-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5514 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't inspect unloaded associations. Closes #2905.Jeremy Kemper2006-11-101-0/+29
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5478 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* SQLite: use AUTOINCREMENT primary key in >= 3.1.0. Closes #6588.Jeremy Kemper2006-11-091-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5477 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Cache inheritance_column. Closes #6592.Jeremy Kemper2006-11-091-2/+14
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5474 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Firebird: decimal/numeric support. Closes #6408.Jeremy Kemper2006-11-071-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5459 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Find with :include respects scoped :order. Closes #5850.Jeremy Kemper2006-11-071-0/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5445 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Support nil and Array in :conditions => { attr => value } hashes. Closes #6548.Jeremy Kemper2006-11-051-2/+14
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5435 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* SQLite: count(distinct) queries supported in >= 3.2.6, fix calculations ↵Jeremy Kemper2006-11-054-38/+21
| | | | | | workaround, remove count(distinct) query rewrite, cleanup test connection scripts. Closes #6544. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5426 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Dynamically generate reader methods for serialized attributes. Closes #6362.Jeremy Kemper2006-11-021-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5416 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation: object transactions warning.Jeremy Kemper2006-11-021-6/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5405 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* has_one :dependent => :nullify ignores nil associates. Closes #6528.Jeremy Kemper2006-11-021-1/+11
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5401 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Oracle: resolve test failures, use prefetched primary key for inserts, check ↵Jeremy Kemper2006-11-014-7/+9
| | | | | | for null defaults. Factor out some common methods from all adapters. Closes #6515. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5384 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix has_many :through to add the appropriate conditions when going through ↵Rick Olson2006-10-153-2/+29
| | | | | | an association using STI. Closes #5783. [Jonathan Viney] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5305 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* automatically add primary key to #select_limited_ids_list order by clause ↵Rick Olson2006-10-131-1/+1
| | | | | | for databases that require order columns in the distinct statements (postgresql) [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5292 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* fix select_limited_ids_list issues in postgresql, retain current behavior in ↵Rick Olson2006-10-131-2/+1
| | | | | | other adapters [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5291 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* add test for select_limited_ids_list that passes in mysql/sqlite and fails ↵Rick Olson2006-10-131-0/+15
| | | | | | in postgresql git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5290 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Restore eager condition interpolation, document it's differences [Rick]Rick Olson2006-10-112-1/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5284 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't rollback in teardown unless a transaction was started. Don't start a ↵Jeremy Kemper2006-10-091-1/+27
| | | | | | transaction in create_fixtures if a transaction is started. Closes #6282. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5270 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add #delete support to has_many :through associations. Closes #6049 [Martin ↵Rick Olson2006-10-091-0/+33
| | | | | | Landers] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5267 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Removes the ability for eager loaded conditions to be interpolated, since ↵Rick Olson2006-10-096-7/+14
| | | | | | there is no model instance to use as a context for interpolation. #5553 [turnip@turnipspatch.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5264 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed rename_table on SQLite tables with indexes defined (closes #5942) ↵David Heinemeier Hansson2006-10-091-0/+21
| | | | | | [brandon@opensoul.org] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5260 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added timeout option to SQLite3 configurations to deal more gracefully with ↵David Heinemeier Hansson2006-10-091-1/+1
| | | | | | SQLite3::BusyException, now the connection can instead retry for x seconds to see if the db clears up before throwing that exception (closes #6126) [wreese@gmail.com] Added default timeout setting of 5 seconds to SQLite3 database.yml configurations [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5258 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added update_attributes! which uses save! to raise an exception if a ↵David Heinemeier Hansson2006-10-091-1/+38
| | | | | | validation error prevents saving (closes #6192) [jonathan] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5256 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecated add_on_boundary_breaking (use validates_length_of instead) ↵David Heinemeier Hansson2006-10-092-18/+13
| | | | | | (closes #6292) [BobSilva] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5255 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* The has_many create method works with polymorphic associations. Closes #6361.Jeremy Kemper2006-10-081-0/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5230 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* add a failing test so we can make it happy againJamis Buck2006-10-041-0/+13
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5225 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* save! shouldn't validate twice. Closes #6324.Jeremy Kemper2006-10-021-0/+6
| | | | 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-0/+39
| | | | | | 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
* 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
* Deprecation: count class method should be called with an options hash rather ↵Jeremy Kemper2006-09-266-10/+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-2/+15
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5188 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* organize associations testsJeremy Kemper2006-09-255-0/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5181 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* use a real testJeremy Kemper2006-09-251-9/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5180 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Duplicate the hash provided to AR::Base#to_xml to prevent unexpected side ↵Michael Koziarski2006-09-241-0/+15
| | | | | | 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-1/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5130 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Stray code.Jeremy Kemper2006-09-151-2/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5117 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation tests. Remove warnings for dynamic finders and for the foo_count ↵Jeremy Kemper2006-09-1510-252/+340
| | | | | | ethod if it's also an attribute. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5116 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Mock Time.now for more accurate Touch mixin tests. Closes #6213.Jeremy Kemper2006-09-141-10/+44
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5106 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Rollback [4917]. Closes #785.Jeremy Kemper2006-09-071-2/+2
| | | | 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-053-58/+71
| | | | | | 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-053-71/+58
| | | | | | 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