aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
Commit message (Collapse)AuthorAgeFilesLines
* Add inverse polymorphic association support. [#3520 state:resolved]George Ogata2009-12-281-0/+4
| | | | Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
* Revert "Revert "Assert primary key does not exist in habtm when the ↵Jeremy Kemper2009-11-231-1/+1
| | | | | | | | | | | | | association is defined, instead of doing that everytime a record is inserted."" This reverts commit 2b82708b0efb3a3458e8177beab58f0c585788ae. [#3128 state:resolved] Conflicts: activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
* Enable use of MySQL stored procedures by default.Justin Bailey2009-09-171-0/+12
| | | | | | [#3204 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix has_one with foreign_key and primary_key association bug which caused ↵Graeme Porteous2009-09-121-0/+1
| | | | | | | | the associated object being lost when saving the owner. [#1756 state:resolved] Mixed in a bit from patch by ransom-briggs. [#2813 state:resolved] Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
* Revert "Assert primary key does not exist in habtm when the association is ↵Jeremy Kemper2009-09-021-1/+1
| | | | | | | | | | defined, instead of doing that everytime a record is inserted." Test failures on PostgreSQL. [#3128 state:open] This reverts commit da636809daca9c338200811d3590e446f57c8e81.
* Assert primary key does not exist in habtm when the association is defined, ↵José Valim2009-09-011-1/+1
| | | | | | | | instead of doing that everytime a record is inserted. [#3128 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* PostgreSQL: XML datatype supportLeonardo Borges2009-08-091-2/+13
| | | | | | [#1874 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* has_many :through create should not raise validation errorsrailsbob2009-08-091-0/+4
| | | | | | [#2934 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* fix schema_dumper_test for Oracle as it supports precision up to 38Raimonds Simanovskis2009-08-061-1/+6
|
* added additional objects necessary for OracleAdapter specific testsRaimonds Simanovskis2009-08-062-3/+48
| | | | | if OracleAdapter is used then use VARCHAR2(4000) instead of CLOB datatype as CLOB data type has many limitations in Oracle SELECT WHERE clause which causes many unit test failures
* Add simple support for ActiveModel's StateMachine for ActiveRecordJoshua Peek2009-08-041-0/+7
|
* Add primary_key option to belongs_to associationSzymon Nowak2009-07-151-0/+7
| | | | | | [#765 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Ensure hm:t#create respects source associations hash conditions [#2090 ↵mattbauer2009-06-211-0/+1
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* disabled base_test.rb tests that were not Oracle compatible (TIME datatype ↵Raimonds Simanovskis2009-06-091-0/+19
| | | | | | is not supported on Oracle, UPDATE does not support ORDER BY) _before_type_cast on Oracle returns Time and not String added Oracle specific schema definition that was missing for test_default_values test Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Schema dumper now records scale 0 decimal columns as decimal not integer.Giles Alexander2009-06-011-0/+1
| | | | | | | | | | The schema dumper would dump out any decimal or numeric column that had a zero scale as an integer column. This will cause problems for very large precision columns on some DBMSs, particularly PostgreSQL. It also looks strange to see your column change type after moving through schema.rb. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#2741 state:committed]
* Fixed limited eager loading associations with numbers in the name [#2668 ↵Benjamin Floering2009-05-181-0/+1
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* replace the aaa_create_tables_test hack with loading test database schema in ↵Mislav Marohnić2009-05-172-7/+4
| | | | | | the test helper [#2663 state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Revert "Fixed bug with polymorphic has_one :as pointing to an STI record"Jeremy Kemper2009-05-111-2/+1
| | | | | | [#2594 state:open] This reverts commit 99c103be1165da9c8299bc0977188ecf167e06a5.
* Allow you to pass :all_blank to :reject_if option to automatically create a ↵Mike Breen2009-05-101-0/+1
| | | | Proc that will reject any record with blank attributes.
* Providing support for :inverse_of as an option to associations.Murray Steele2009-05-041-0/+20
| | | | | | | | | | | | | | | | | | | | | | You can now add an :inverse_of option to has_one, has_many and belongs_to associations. This is best described with an example: class Man < ActiveRecord::Base has_one :face, :inverse_of => :man end class Face < ActiveRecord::Base belongs_to :man, :inverse_of => :face end m = Man.first f = m.face Without :inverse_of m and f.man would be different instances of the same object (f.man being pulled from the database again). With these new :inverse_of options m and f.man are the same in memory instance. Currently :inverse_of supports has_one and has_many (but not the :through variants) associations. It also supplies inverse support for belongs_to associations where the inverse is a has_one and it's not a polymorphic. Signed-off-by: Murray Steele <muz@h-lame.com> Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fixed bug with polymorphic has_one :as pointing to an STI recordRuy Asan2009-05-011-1/+2
| | | | | | [#2594 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fixed dumping from postgresql columns in index in wrong order. [#2515 ↵Max Lapshin2009-04-211-0/+2
| | | | | | state:resolved] Signed-off-by: Tarmo Tänav <tarmo@itech.ee>
* Quote table names when casting to regclass so that capitalized tables are ↵Scott Woods2009-04-211-0/+4
| | | | | | supported. [#2418 state:resolved] Signed-off-by: Tarmo Tänav <tarmo@itech.ee>
* Added :touch option to belongs_to associations that will touch the parent ↵David Heinemeier Hansson2009-04-161-0/+2
| | | | record when the current record is saved or destroyed [DHH]
* Ensure has_many :through works with changed primary keys [#736 state:resolved]Jim Remsik and Tim Pope2009-03-091-0/+5
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure validates_uniqueness_of considers limit on the field. [#1042 ↵Arthur Klepchukov2009-03-071-0/+4
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Add support for nested object forms to ActiveRecord and the helpers in ↵Eloy Duran2009-02-011-0/+11
| | | | | | | | ActionPack Signed-Off-By: Michael Koziarski <michael@koziarski.com> [#1202 state:committed]
* Sqlite adapter's copy_table incorrectly attempts to recreate a primary key ↵Jacob Dunphy2009-01-291-0/+5
| | | | | | | | | id (:id => true in the create_table) if an :id column is present, even if it isn't a primary_key. This fix sets :id => false if there is an :id column, but it's not the primary_key. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1766 state:committed]
* Fix dirty handling of nullable non-integer numeric columns [#1692 ↵Carlos Kozuszko2009-01-161-0/+1
| | | | | | state:resolved] Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
* Preload uses exclusive scope [#643 state:resolved]Frederick Cheung2008-12-261-2/+4
| | | | | | | | | With self referential associations, the scope for the the top level should not affect fetching of associations, for example when doing Person.male.find :all, :include => :friends we should load all of the friends for each male, not just the male friends.
* Fix preloading of has_one :through associations on belongs_to [#1507 ↵Matt Jones2008-12-181-0/+5
| | | | | | state:resolved] Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
* Remove SQL Server cases from tests for latest adapter work to pass rails ↵Ken Collins2008-11-191-5/+0
| | | | | | expected behavior. Signed-off-by: Michael Koziarski <michael@koziarski.com>
* fix assignment to has_one :through associations.Matt Jones2008-11-151-0/+10
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Create mysql binary_fields table with latin1 character set as with utf8 all ↵Tarmo Tänav2008-08-261-2/+2
| | | | | | the limits would have to be divided by 3 to get the expected text types Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* coerce blank strings to nil values for boolean and integer fieldsJosh Susser2008-08-221-1/+1
| | | | [#860 state:resolved]
* update_counters should update nil values.miloops2008-07-151-0/+1
| | | | | | This allows counter columns with default null instead of requiring default 0. [#493 state:resolved]
* Add has_many :primary_key option to allow setting the primary key on a has ↵Andre Arko2008-07-061-0/+1
| | | | | | many association Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Always treat integer :limit as byte length. [#420 state:resolved]Tarmo Tänav2008-06-221-0/+7
|
* Fix validates_uniqueness_of for SQL keywords [#23 state:resolved]Alex MacCaw2008-05-111-0/+4
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fixed AssociationsPreload such that it doesnt require foreign keys to be ↵David Heinemeier Hansson2008-04-301-0/+5
| | | | integers (fcheung) [#33 state:resolved]
* Fixed that pessimistic locking you reference the quoted table name (Josh ↵David Heinemeier Hansson2008-04-301-0/+1
| | | | Susser) [#67 state:resolved]
* Ensure postgresql tests work when starting from scratch.Frederick Cheung2008-04-301-1/+1
|
* Ensure table names are quoted by the association preloading code.Frederick Cheung2008-04-261-0/+11
| | | | | | [#45 state:resolved] Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Use schema.rb for all databasesFrederick Cheung2008-04-2238-2873/+421
| | | | | | Move adapter specific schema into their own files Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Add support for interleaving migrations by storing which migrations have run ↵Rick Olson2008-04-091-1/+1
| | | | | | in the new schema_migrations table. Closes #11493 [jordi] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9244 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix schema.rb some more. sponsors.sponsorable_type should be a string. ↵Jeremy Kemper2008-03-211-1/+1
| | | | | | References #4756. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9073 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix schema.rb. Please to be testing on more than just MySQL! References #9067.Jeremy Kemper2008-03-211-24/+24
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9072 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add has_one :through support, finally. Closes #4756 [thechrisoshow]Rick Olson2008-03-211-0/+21
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9067 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make the mysql schema dumper roundtrip the limits of text/blob columns. ↵Michael Koziarski2008-03-021-0/+11
| | | | | | Closes #7424 [will.bryant] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8969 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* PostgreSQL: support server versions 7.4 through 8.0 and the ruby-pg driver. ↵Jeremy Kemper2008-02-221-1/+3
| | | | | | Closes #11127 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8922 5ecf4fe2-1ee6-0310-87b1-e25e094e27de