aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
Commit message (Collapse)AuthorAgeFilesLines
* Delegate access to a customized primary key to the conventional id method. ↵Marcel Molina2005-10-131-2/+2
| | | | | | Closes #2444. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2569 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix errors caused by assigning a has-one or belongs-to property to itselfJamis Buck2005-10-131-0/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2562 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r3579@sedna: jeremy | 2005-10-13 12:02:01 -0700Jeremy Kemper2005-10-131-4/+2
| | | | | | | decrease need to edit AR mysql connect details by setting socket to mysql_config --socket. if it doesn't work on your platform, well, you would've had to edit it anyway. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2558 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r3577@sedna: jeremy | 2005-10-13 11:55:20 -0700Jeremy Kemper2005-10-131-0/+17
| | | | | | | Add in_memory_connection for SQLite3 AR tests. Uses :dbfile => ':memory:' so we don't have to manage db files. It seems a bit quirky, so I'm including it as a separate connection type until we iron out the details. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2556 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Update DB2 adapter. Closes #2206.Marcel Molina2005-10-121-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2546 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecated ActiveRecord::Base.threaded_connection in favor of ↵Marcel Molina2005-10-121-1/+1
| | | | | | ActiveRecord::Base.allow_concurrency. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2542 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Protect id attribute from mass assigment even when the primary key is set to ↵Marcel Molina2005-10-121-0/+18
| | | | | | something else. Closes #2438. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2541 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add test coverage for customized primary keys including a failing test for ↵Marcel Molina2005-10-1216-6/+65
| | | | | | #2444. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2540 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add test coverage for content_columns. Closes #2432.Marcel Molina2005-10-111-1/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2532 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Speed up the setting of table_name. Closes #2428.Marcel Molina2005-10-102-0/+20
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2520 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix typo of 'constrains' to 'contraints'. Closes #2069.Marcel Molina2005-10-091-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add ability to get all siblings, including the current child, with ↵Marcel Molina2005-10-091-0/+9
| | | | | | acts_as_tree. Recloses #2140. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2507 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add geometric type for postgresql adapter. Closes #2233.Marcel Molina2005-10-093-0/+74
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2498 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add option (true by default) to generate reader methods for each attribute ↵Marcel Molina2005-10-071-0/+20
| | | | | | of a record to avoid the overhead of calling method missing. In partial fullfilment of #1236. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2483 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add convenience predicate methods on Column class. In partial fullfilment of ↵Marcel Molina2005-10-061-0/+3
| | | | | | #1236. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2482 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Raise an exception when invalid options are passed to ↵Marcel Molina2005-10-062-2/+6
| | | | | | ActiveRecord::Base.find. Closes #2363. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2481 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* sqlite topics.approved should default to true like the other dbsJeremy Kemper2005-10-061-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2480 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixup tests for [2474].Jeremy Kemper2005-10-062-11/+11
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2478 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add rename_table to mysql, sqlite and postgres adapters for use in migrationsTobias Lütke2005-10-061-0/+19
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2477 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* smallint -> boolean in pg sqlJeremy Kemper2005-10-061-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2475 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Quote booleans according the rules defined by the adapterMichael Koziarski2005-10-065-8/+13
| | | | | | | | | | * SQLite schema has been updated * Postgresql schema needs to be fixed too Simplify AR::Base#toggle to store the boolean, not the quoted value * expand the tests git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2474 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Association validation does not belong in a before_save callback: move it ↵Jeremy Kemper2005-10-022-23/+62
| | | | | | into a validation method. Restores the expected model.valid? == model.save. Add tests for cancelling save by returning false from a before_save callback. Remove assumption that before_destroy's return value indicates whether the record was destroyed. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2434 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Move transaction thread-safety test to transactions_test. Check that ↵Jeremy Kemper2005-09-302-47/+79
| | | | | | simultaneous transactions don't step on each others' toes. Check that simultaneous transactions don't give dirty reads (read-committed txn isolation or greater.) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2417 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use transactional fixtures by default for AR tests. Set ↵Jeremy Kemper2005-09-301-11/+6
| | | | | | ENV['AR_NO_TX_FIXTURES'] to yes to disable. Tidy up abstract_unit. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2416 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Require topic model rather than assume another test has already.Jeremy Kemper2005-09-301-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2415 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Disable transactional fixtures for ar_schema_test and schema_test_postgresqlJeremy Kemper2005-09-302-2/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2414 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix broken testcase for transactionsNicholas Seckar2005-09-291-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2409 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Clean up and extend test coverage for validates_numericality_ofJeremy Kemper2005-09-291-37/+60
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2402 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix transactions so that calling return while inside a transaction will not ↵Nicholas Seckar2005-09-281-1/+32
| | | | | | leave an open transaction on the connection. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2398 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add failing test that shows that AR::Migration.remove_column fails silently ↵Marcel Molina2005-09-281-3/+17
| | | | | | with SQLite when passed arguments as symbols. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2396 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r3657@asus: jeremy | 2005-09-28 00:32:33 -0700Jeremy Kemper2005-09-281-1/+3
| | | | | | | Also test that client.firm_id.nil? after firm.clients.clear when clients is not :dependent git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2385 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r3653@asus: jeremy | 2005-09-28 00:23:49 -0700Jeremy Kemper2005-09-282-12/+69
| | | | | | | Ticket 2221 - model.association.clear should destroy associated objects if :dependent => true instead of nullifying their foreign keys git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2384 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Returning false in before_destroy should cancel action. Closes #1829.Scott Barron2005-09-281-0/+37
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2381 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ticket 2256 - Recognize PostgreSQL NOW() default as equivalent to ↵Jeremy Kemper2005-09-272-16/+23
| | | | | | CURRENT_TIMESTAMP/CURRENT_DATE git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2378 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix serialization problem with YAML in 1.8.3Scott Barron2005-09-271-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2360 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r3603@asus: jeremy | 2005-09-26 19:10:00 -0700Jeremy Kemper2005-09-261-5/+10
| | | | | | | Add unit tests for nil assigned to validates_size_of :attr, :within git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2354 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make migrations honor table name prefixes and suffixes.Marcel Molina2005-09-261-2/+53
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2352 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r3591@asus: jeremy | 2005-09-26 17:01:30 -0700Jeremy Kemper2005-09-261-43/+22
| | | | | | | Simplify binary unit test. Use flowers.jpg instead of associations.png git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2348 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r3589@asus: jeremy | 2005-09-26 16:58:40 -0700Jeremy Kemper2005-09-262-0/+0
| | | | | | | Remove associations.png in favor of flower.jpg which reveals a bug in binary escaping. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2346 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Include the orders table in *.drop.sqlJeremy Kemper2005-09-266-0/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2342 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Standardize the interpretation of boolean columns in the Mysql and Sqlite ↵Jamis Buck2005-09-252-2/+25
| | | | | | adapters. (Use MysqlAdapter.emulate_booleans = false to disable this behavior) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2335 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use assignment instead of callDavid Heinemeier Hansson2005-09-251-6/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2327 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added new symbol-driven approach to activating observers with Base#observer ↵David Heinemeier Hansson2005-09-251-2/+2
| | | | | | [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2326 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Wrap :conditions in parentheses to prevent problems with OR's #1871Jamis Buck2005-09-244-9/+35
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2324 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added AbstractAdapter#select_value and AbstractAdapter#select_values as ↵David Heinemeier Hansson2005-09-241-0/+13
| | | | | | convenience methods for selecting single values, instead of hashes, of the first column in a SELECT #2283 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2323 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make sqlite adapter pass all testsJamis Buck2005-09-231-0/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2315 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add ActiveRecord::SchemaDumper for dumping a DB schema to a pure-ruby file, ↵Jamis Buck2005-09-234-0/+92
| | | | | | making it easier to consolidate large migration lists and port database schemas between databases. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2312 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that the create_x method from belongs_to wouldn't save the association ↵David Heinemeier Hansson2005-09-201-0/+3
| | | | | | properly #2042 [Florian Weber] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2279 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed saving a record with two unsaved belongs_to associations pointing to ↵Jamis Buck2005-09-201-0/+45
| | | | | | the same object #2023 [Tobias Luetke] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2278 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that Observers didn't observe sub-classes #627 [Florian Weber]David Heinemeier Hansson2005-09-191-0/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2263 5ecf4fe2-1ee6-0310-87b1-e25e094e27de