aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
Commit message (Collapse)AuthorAgeFilesLines
* Add records to has_many :through using <<, push, and concat by creating the ↵Jeremy Kemper2006-08-181-7/+17
| | | | | | 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-0/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4783 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Shorten index name.Jeremy Kemper2006-08-161-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4777 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Included associations: go deep.Jeremy Kemper2006-08-167-4/+66
| | | | 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-0/+10
| | | | | | 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-4/+8
| | | | | | parent's table name. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4770 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make indexed columns easy to extract from the index name. Oracle users ↵Jeremy Kemper2006-08-151-8/+11
| | | | | | should explicitly assign index names due to field length restrictions. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4768 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Migrations: uniquely name multicolumn indexes so you don't have to.Jeremy Kemper2006-08-151-1/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4767 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix for deep includes on the same association.Jeremy Kemper2006-08-143-0/+29
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4758 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Tweak fixtures so they don't try to use a non-ActiveRecord class. [Kevin Clark]Rick Olson2006-08-111-0/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4752 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* PostgreSQL: autodetected sequences work correctly with multiple schemas. ↵Jeremy Kemper2006-08-091-0/+75
| | | | | | Rely on the schema search_path instead of explicitly qualifying the sequence name with its schema. Closes #5280. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4737 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Cache nil results for has_one associations so multiple calls don't call the ↵Rick Olson2006-08-081-0/+5
| | | | | | database. Closes #5757. [Michael A. Schoen] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4721 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't save has_one associations unnecessarily. Closes #5735.Jeremy Kemper2006-08-061-0/+17
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4690 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* fixed lifecycle tests so they instantiate the observersRick Olson2006-08-061-1/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4685 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactored select routing for SQL Server adapter (closes #5683) [tom@popdog.net]David Heinemeier Hansson2006-08-051-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4671 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that default timezones for new / initialize should uphold utc setting ↵David Heinemeier Hansson2006-08-051-0/+16
| | | | | | (closes #5709) [daniluk@yahoo.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4670 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* The exists? class method should treat a string argument as an id rather than ↵Jeremy Kemper2006-08-031-7/+8
| | | | | | as conditions. Closes #5698. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4655 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed to_xml with :include misbehaviors when invoked on array of model ↵David Heinemeier Hansson2006-08-031-0/+13
| | | | | | instances (closes #5690) [alexkwolfe@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4652 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added support for conditions on Base.exists? (closes #5689) [josh@joshpeek.com]David Heinemeier Hansson2006-08-031-0/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4651 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* more concise destroy testJeremy Kemper2006-08-011-13/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4646 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Calculate sum with SQL, not Enumerable on HasManyThrough Associations. [Dan ↵Rick Olson2006-07-311-0/+4
| | | | | | Peterson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4640 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r4880@ks: jeremy | 2006-07-30 23:52:59 -0700Jeremy Kemper2006-07-311-6/+25
| | | | | | | | | Only set method_name = md.pre_match if the pre_match is an attribute. Plays nicely with other ? suffixed attribute methods. r4881@ks: jeremy | 2006-07-30 23:53:37 -0700 Heavier testing for attribute method suffixes. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4635 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r4854@ks: jeremy | 2006-07-30 00:59:18 -0700Jeremy Kemper2006-07-311-0/+30
| | | | | | | | | | | Attribute methods r4877@ks: jeremy | 2006-07-30 20:23:53 -0700 Factor the attribute#{suffix} methods out of method_missing for easier extension. r4878@ks: jeremy | 2006-07-30 20:42:23 -0700 More specific method naming, declare many attribute method suffixes, set up default suffixes at module include rather than lazily. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4632 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Patch sql injection vulnerability when using integer or float columns.Jamis Buck2006-07-271-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4626 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* BigDecimal: schema dumper formattingJeremy Kemper2006-07-241-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4619 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow #count through a has_many association to accept :include. [Dan Peterson]Rick Olson2006-07-241-0/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4618 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* PostgreSQL: return array fields as strings. Closes #4664.Jeremy Kemper2006-07-101-0/+52
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4605 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Test connections use AR::Base.configurations. References #5497.Jeremy Kemper2006-07-1012-177/+174
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4602 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* SQLServer: added tests to ensure all database statements are closed, ↵Jeremy Kemper2006-07-103-82/+157
| | | | | | refactored identity_insert management code to use blocks, removed update/delete rowcount code out of execute and into update/delete, changed insert to go through execute method, removed unused quoting methods, disabled pessimistic locking tests as feature is currently unsupported, fixed RakeFile to load sqlserver specific tests whether running in ado or odbc mode, fixed support for recently added decimal types, added support for limits on integer types. Closes #5670. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4601 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Oracle: BigDecimal support. Closes #5667.Jeremy Kemper2006-07-101-2/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4600 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r4704@asus: jeremy | 2006-06-27 12:00:19 -0700Jeremy Kemper2006-07-0827-44/+350
| | | | | | | | | | | | | | | decimal r4705@asus: jeremy | 2006-06-27 12:20:47 -0700 current_adapter? checks whether any of its arguments is the name of the current adapter class r4834@asus: jeremy | 2006-07-08 13:08:24 -0700 Room to float. r4835@asus: jeremy | 2006-07-08 13:09:18 -0700 Give lock test a few chances. r4836@asus: jeremy | 2006-07-08 13:12:05 -0700 Numeric and decimal columns map to BigDecimal instead of Float. Those with scale 0 map to Integer. Closes #5454. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4596 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Firebird migrations support. Closes #5337.Jeremy Kemper2006-07-085-76/+148
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4594 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Rollback [4584], bad test. Reopens #3819.Jeremy Kemper2006-07-081-14/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4586 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't modify options parameters in-place. Closes #3819.Jeremy Kemper2006-07-081-1/+14
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4584 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* PostgreSQL: correctly quote microseconds in timestamps. Closes #5641.Jeremy Kemper2006-07-072-1/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4579 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* More succinct current_adapter? Enable locking duel for Oracle.Jeremy Kemper2006-07-075-65/+67
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4576 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Oracle: use nonblocking queries if allow_concurrency is set, fix pessimistic ↵Jeremy Kemper2006-07-071-1/+7
| | | | | | locking, don't guess date vs. time by default (set OracleAdapter.emulate_dates = true for the old behavior), adapter cleanup. Closes #5635. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4574 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Rename test file so it runs for MySQL only.Jeremy Kemper2006-07-061-0/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed testDavid Heinemeier Hansson2006-07-051-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4556 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed a few Oracle issues: Allows Oracle's odd date handling to still work ↵David Heinemeier Hansson2006-07-052-2/+2
| | | | | | consistently within #to_xml, Passes test that hardcode insert statement by dropping the :id column, Updated RUNNING_UNIT_TESTS with Oracle instructions, Corrects method signature for #exec #5294 [schoenm@earthlink.net] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4552 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* rake should run active_schema_mysql_test.rb (closes #5390)David Heinemeier Hansson2006-07-051-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4549 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Doc fix (closes #5504) [lee@omara.ca]David Heinemeier Hansson2006-07-051-0/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4543 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r4738@asus: jeremy | 2006-06-29 20:18:43 -0700Jeremy Kemper2006-06-301-19/+38
| | | | | | | Observers also watch subclasses created after they are declared. Closes #5535. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4521 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* PostgreSQL: support microsecond time resolution. Closes #5492.Jeremy Kemper2006-06-252-1/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4494 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add AssociationCollection#sum since the method_missing invokation has been ↵Nicholas Seckar2006-06-251-0/+4
| | | | | | shadowed by Enumerable#sum. Closes #5500. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4493 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added find_or_initialize_by_X which works like find_or_create_by_X but ↵Sam Stephenson2006-06-201-0/+15
| | | | | | doesn't save the newly instantiated record git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4473 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r4669@asus: jeremy | 2006-06-20 12:53:36 -0700Jeremy Kemper2006-06-201-21/+35
| | | | | | | Getting picayune with locking_test. Closes #4871. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4472 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r4664@asus: jeremy | 2006-06-19 18:55:36 -0700Jeremy Kemper2006-06-201-0/+12
| | | | | | | Use the #lock method to obtain a row lock on a single record. Simply reloads the record with :lock => true. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4462 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r4644@asus: jeremy | 2006-06-16 14:57:03 -0700Jeremy Kemper2006-06-193-72/+163
| | | | | | | | | | | | | | | | | | | | | locking r4645@asus: jeremy | 2006-06-17 12:41:30 -0700 missing reply fixture r4646@asus: jeremy | 2006-06-19 13:05:23 -0700 Use a per-thread (rather than global) transaction mutex so you may execute concurrent transactions on separate connections. r4647@asus: jeremy | 2006-06-19 13:07:23 -0700 PostgreSQL: introduce allow_concurrency option which determines whether to use blocking or asynchronous #execute. Adapters with blocking #execute will deadlock Ruby threads. The default value is ActiveRecord::Base.allow_concurrency. r4648@asus: jeremy | 2006-06-19 13:08:40 -0700 Pass the default allow_concurrency when instantiating new connections. r4649@asus: jeremy | 2006-06-19 13:11:12 -0700 Break out concurrent transaction tests and run them for PostgreSQLAdapter only (need to fork or system('some_test_script') for the other adapters) r4650@asus: jeremy | 2006-06-19 13:42:48 -0700 Row locking. Provide a locking clause with the :lock finder option or true for the default "FOR UPDATE". r4661@asus: jeremy | 2006-06-19 15:36:51 -0700 excise the junk mutex git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4460 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Change AR::Base#to_param to return a String instead of a Fixnum. Closes #5320.Nicholas Seckar2006-06-191-0/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4459 5ecf4fe2-1ee6-0310-87b1-e25e094e27de