aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
Commit message (Collapse)AuthorAgeFilesLines
* eliminate alias_method_chain from ActiveRecordwycats2010-05-091-3/+6
|
* updated AR to work with the AMo model validation changesJosh Kalderimis2010-05-081-1/+1
|
* Revert "Add index length support for MySQL [#1852 state:open]"José Valim2010-05-082-25/+0
| | | | | | | | | | | | | This commit breaks dumping a few tables, as the sessions table. To reproduce, just create a new application and: rake db:sessions:create rake db:migrate rake db:test:prepare And then look at the db/schema.rb file (ht: Sam Ruby). This reverts commit 5b95730edc33ee97f53da26a3868eb983305a771.
* Add index length support for MySQL [#1852 state:resolved]Emili Parreno2010-05-082-0/+25
| | | | | | | | | | | | Example: add_index(:accounts, :name, :name => 'by_name', :length => 10) => CREATE INDEX by_name ON accounts(name(10)) add_index(:accounts, [:name, :surname], :name => 'by_name_surname', :length => {:name => 10, :surname => 15}) => CREATE INDEX by_name_surname ON accounts(name(10), surname(15)) Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Make find_or_create and find_or_initialize work mixing explicit parameters ↵Santiago Pastorino2010-05-071-1/+17
| | | | | | and a hash [#4457 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix unintuitive behavior with multiple order and group clausesErnie Miller2010-05-061-0/+10
| | | | | | [#4545 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Use primary key in conditions, not 'id' [#4395 state:resolved]Mathieu Arnold2010-05-041-0/+25
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Favor %{} in all code instead of (deprecated) {{}} as interpolation syntax ↵Lawrence Pit2010-05-031-2/+2
| | | | | | for I18n Signed-off-by: José Valim <jose.valim@gmail.com>
* to_xml with :include should skip_instruct on the included records [#4506 ↵Lawrence Pit2010-04-302-1/+10
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* test cases for record.to_xml [#458 state:resolved]Neeraj Singh2010-04-302-0/+12
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Update after_commit and after_rollback docs and tests to use new style API ↵Brian Durand2010-04-291-6/+6
| | | | | | | | with an :on options instead of on_* suffix. [#2991] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Add after_commit and after_rollback callbacks to ActiveRecord that are ↵Brian Durand2010-04-292-14/+291
| | | | | | | | called after transactions either commit or rollback on all records saved or destroyed in the transaction. [#2991 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* making rake:migrate VERSION=0 a noop called in succession. [#2137 ↵Neeraj Singh2010-04-291-0/+19
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Move several configuration values from Hash to ActiveSupport::XmlMini, which ↵José Valim2010-04-292-6/+3
| | | | | | both Hash and Array depends on. Also, refactored ActiveModel serializers to just use ActiveSupport::XmlMini.to_tag. As consequence, if a serialized attribute is an array or a hash, it's not encoded as yaml, but as a hash or array.
* Fix eager loading of associations causing table name collisionsErnie Miller2010-04-281-0/+9
| | | | | | [#4463 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Destroy respects optimistic locking.Curtis Hawthorne2010-04-271-3/+48
| | | | | | | | | | Now works with :dependent => :destroy and includes unit tests for that case. Also includes better error messages when updating/deleting stale objects. [#1966 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Support fixtures for namespaced models [#2965 state:resolved]Andrew White2010-04-257-1/+38
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Remove quoted_string_prefix entirely since PostgreSQL was the only database ↵Jeremy Kemper2010-04-241-2/+2
| | | | adapter relying on it.
* Missing require addedSantiago Pastorino2010-04-181-0/+1
|
* working around syck defects by optionally matching a space [#4426 ↵Aaron Patterson2010-04-171-1/+1
| | | | | | state:resolved] Signed-off-by: wycats <wycats@gmail.com>
* making yaml tests less specific to emitter. [#4425 state:resolved]Aaron Patterson2010-04-171-1/+2
| | | | Signed-off-by: wycats <wycats@gmail.com>
* fixing invalid yaml [#4424 state:resolved]Aaron Patterson2010-04-171-1/+2
| | | | Signed-off-by: wycats <wycats@gmail.com>
* ActiveModel::Observing: stop using Observable Ruby module, re-implement ↵Mislav Marohnić2010-04-161-0/+20
| | | | | | | | | `notify_observers` `Observable#notify_observers` from Ruby always returns false (which halts ActiveRecord callback chains) and has extra features (like `changed`) that were never used. Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* merge callbacks_observers_test.rb into lifecycle_test.rb where other ↵Mislav Marohnić2010-04-162-37/+34
| | | | | | | | observers test reside Benefits: test able to run independently, subclassing instead of changing the original Comment model Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* fix a failure and some warnings on 1.9.2 [#4417 state:resolved]Aaron Patterson2010-04-162-2/+2
| | | | Signed-off-by: Xavier Noria <fxn@hashref.com>
* Ensure not to load the entire association when bulk updating existing ↵Pratik Naik2010-04-141-1/+11
| | | | records using nested attributes
* Refactor compute_type to handle situations where the correct class is ↵Andrew White2010-04-127-9/+69
| | | | | | already loaded Signed-off-by: wycats <wycats@gmail.com>
* make ActiveRecord::Base.subclasses a public methodEmmanuel Oga2010-04-121-0/+4
| | | | Signed-off-by: wycats <wycats@gmail.com>
* table_name_prefix and table_name_suffix are class_attributes instead of ↵Phil Smith2010-04-121-7/+51
| | | | | | cattr_accessors. [#4230] Signed-off-by: José Valim <jose.valim@gmail.com>
* mode postgresql adapters table_exists? method take the schema in to account. ↵Aaron Patterson2010-04-111-0/+15
| | | | | | [#4341 state:resolved] Signed-off-by: wycats <wycats@gmail.com>
* clearing up many warnings, removing unnecessary regular expresion ↵Aaron Patterson2010-04-101-1/+1
| | | | | | comparisons [#4365 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Made arrays of ActiveRecords, and any classes, with namespaces convert to ↵mfoster2010-04-101-1/+11
| | | | | | valid xml. [#3824 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* clear the rest of the warnings, run with warnings turned on [#4332 ↵Aaron Patterson2010-04-101-25/+39
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* kill warnings on 1.8.7 [#4331 state:resolved]Aaron Patterson2010-04-101-4/+4
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Revert "When creating database with rake, create schemas in ↵Michael Koziarski2010-04-092-13/+0
| | | | | | | | | | | | | schema_search_path if it doesn't exist." This reverts commit 6c2a0675f11a9b5b8e88ed7dbccd65cb51be8029. Reverting because it breaks the ability to run tests using a non-superuser. Conflicts: activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb activerecord/lib/active_record/railties/databases.rake
* Dirty datetime attributes should be aware of time zone info [#3658 ↵Kristopher Murata2010-04-081-0/+95
| | | | | | state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Reset named scope cache whenever the @target is resetPratik Naik2010-04-071-0/+10
|
* Memoize association.named_scope callsPratik Naik2010-04-051-0/+9
|
* Add tests to prevent regression of lazy evaluation of has_many ..., ↵Andrew White2010-04-041-0/+18
| | | | | | | | :dependent => :___ [#2627 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Add Relation extensionsPratik Naik2010-04-022-0/+22
|
* Add tests for postgresql column type mapping updates [#4270 state:resolved]Ernie Miller2010-03-311-0/+17
| | | | Signed-off-by: Emilio Tagua <miloops@gmail.com>
* Dont try to load the record from the db if preloading didn't find anythingPratik Naik2010-03-311-0/+6
|
* Fix failing test in MySQL.Emilio Tagua2010-03-301-3/+8
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Named scopes shouldn't test equality using to_a if it's not an Array, this ↵Emilio Tagua2010-03-301-3/+9
| | | | | | was causing records to be loaded before they were needed. Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix dom_id for ActiveRecord [#4296 state:resolved]José Valim2010-03-301-0/+6
|
* Fix honoring :primary_key option when joining or eager loading a belongs_to ↵Ernie Miller2010-03-291-0/+13
| | | | | | | | association [#765 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Warn scoped order and limit are ignored. [#4123 state:resolved]Emilio Tagua2010-03-291-3/+13
|
* Add the ability to specify table_name_prefix on individual modulesAndrew White2010-03-282-0/+45
| | | | Signed-off-by: wycats <wycats@gmail.com>
* defining a named_scope which overwrites an existing method is now allowed we ↵Matthew Rudy Jacobs2010-03-281-2/+15
| | | | | | | | | just log a warning. This was motivated by the fact that :open is defined on all classes as such the named_scope "open" can never be used, without hacking ActiveRecord with an "undef_method" [#4083 state:resolved] Signed-off-by: wycats <wycats@gmail.com>
* Add :dependent = to has_one and has_many [#3075 state:resolved]Rizwan Reza2010-03-284-2/+29
|