Commit Graph

2038 Commits

Author SHA1 Message Date
Aaron Patterson
5e2b473b47 reorganizing adapter specific tests. [#4974 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-25 14:47:14 -07:00
Santiago Pastorino
efbd0eb9f7 Order is not guaranteed here, ordering by id of people table makes it work 2010-06-25 12:44:57 -07:00
Neeraj Singh and Santiago Pastorino
0ebb5bf659 Support for multiple selects added
[#4841 state:committed]
2010-06-25 15:57:04 -03:00
Emilio Tagua
fdb7f84eb1 Remove deprecated block usage in composed_of. 2010-06-24 11:17:05 -03:00
José Valim
6788db824a Move Rails::LogSubscriber to ActiveSupport::LogSubscriber, allowing frameworks like ActiveRecord and ActiveResource to log outsude Rails::Application [#4816 state:resolved] 2010-06-24 13:23:43 +02:00
Emilio Tagua
5441e082f9 Add tests for relation count. Fix other tests that were conceptually wrong.
[#4882 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-24 11:41:55 +02:00
Neeraj Singh
0bf3baa6b3 adding fix for to_xml for ActiveRecord relation object
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-23 18:00:32 +02:00
Neeraj Singh
eb04408a20 ActiveRecord's relation object should respond to to_json and to_yaml
[#4547 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-23 18:00:25 +02:00
Neeraj Singh
a3ce6fcc56 adding column named 'group' to ensure that nothing breaks given that 'group' is sql reserved word
[#4945 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-23 17:46:37 +02:00
Paul Gillard
d132dd3352 Don't clone associations [#4894 state:resolved]
Cloning an active record object should be shallow in that it should copy attributes but not associations. This was no longer true as a result of #3164.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-23 09:27:15 +02:00
Jeff Dean
e639536ea8 remove_column should raise an ArgumentError when no columns are passed [#4803 state:resolved]
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2010-06-23 16:21:29 +12:00
Santiago Pastorino
f61ac89947 Avoid method redefined warning
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-22 21:16:59 +02:00
Neeraj Singh
7033be5f72 test for #4917
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-22 18:04:38 +02:00
Emilio Tagua
7df105b1e6 Fix order method to accept relation attributes.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-22 16:44:10 +02:00
Jeroen van Dijk
26392c4ac5 Make ActiveModel::Errors#add_on_blank and #add_on_empty accept an options hash and make various Validators pass their (filtered) options.
This makes it possible to pass additional options through Validators to message generation. E.g. plugin authors want to add validates_presence_of :foo, :format => "some format".

Also, cleanup the :default vs :message options confusion in ActiveModel validation message generation.

Also, deprecate ActiveModel::Errors#add_on_blank(attributes, custom_message) in favor of ActiveModel::Errors#add_on_blank(attributes, options).

Also, refactoring of ActiveModel and ActiveRecord Validation tests. Test are a lot more DRY now. Better test coverage as well now.

The first four points were reapplied from an older patch of Sven Fuchs which didn't apply cleanly anymore and was not complete yet.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-21 11:55:21 +02:00
rohit
95a8f252c0 remove executable permission from files that don't need it. [#4802 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-20 00:50:48 +02:00
James Le Cuirot
f664c57fe8 Don't overwrite unsaved updates when loading an association but preserve the order of the loaded records. Reapplied from before but now allows already-saved records to be refreshed.
[#4830 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-20 00:32:06 +02:00
José Valim
72725d7b7f Merge branch 'master' of github.com:rails/rails 2010-06-20 00:12:54 +02:00
José Valim
033e0a041f ActiveRecord and ActionPack now use the new descendants implementation. 2010-06-19 17:15:21 +02:00
Master Lambaster
a7cae64104 Fix test which prevents connection reset on failing and remove hardcoded connection
[#4689 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-18 15:28:14 -07:00
Brian Durand
237165feb3 Fix bug with rolling back frozen attributes.
[#2991]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-18 15:11:17 -07:00
Aaron Patterson
8e56085817 use assert_in_delta() for floating point comparisons in tests [#4871 state:resolved]
Signed-off-by: Carl Lerche <carllerche@mac.com>
2010-06-16 10:09:59 -07:00
Xavier Noria
f17159b029 edit pass: the names of Rails components have a space, ie, "Active Record", not "ActiveRecord" 2010-06-14 23:22:04 +02:00
José Valim
85cc1fa657 Revert "Don't overwrite unsaved updates when loading an association but preserve the order of the loaded records. [#4642 state:open]"
This commit introduced a regression described in ticket [#4830].

This reverts commit 0265c708b9.
2010-06-11 17:05:54 +02:00
Neeraj Singh
e11bb95d56 Validators should at model level and not at AR:Base level [Closes #4804]
[#4804 state:resolved]

Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2010-06-10 11:50:42 -04:00
James Le Cuirot
0265c708b9 Don't overwrite unsaved updates when loading an association but preserve the order of the loaded records. [#4642 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2010-06-09 18:17:52 +05:30
Santiago Pastorino
6898c167c3 Make sure about which is the first element of the query, fixes a postgresql 8.4 failing test
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-09 10:06:41 +02:00
Santiago Pastorino
cfacae1a7d SQLite2Adapter doesn't exist
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-09 10:06:24 +02:00
Jeremy Kemper
b070739240 Revert "Temporarily revert "Update after_commit and after_rollback docs and tests to use new style API with an :on options instead of on_* suffix." and "Add after_commit and after_rollback callbacks to ActiveRecord that are called after transactions either commit or rollback on all records saved or destroyed in the transaction.""
This reverts commit 1b2941cba1.

[#2991]
2010-06-08 17:05:29 -04:00
Emilio Tagua
4b4a548a60 Avoid PostgreSQL and MySQL tests warnings.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 22:36:19 +02:00
Andrew Bloomgarden
0e9b9d5985 Fix ActiveRecord::Base.compute_type swallowing NoMethodError. [#4751 state:resolved]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2010-06-08 15:34:47 -04:00
Emilio Tagua
ab2877cbe8 Add parentheses to avoid warnings when running AR tests.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 21:16:19 +02:00
Jeremy Kemper
1b2941cba1 Temporarily revert "Update after_commit and after_rollback docs and tests to use new style API with an :on options instead of on_* suffix." and "Add after_commit and after_rollback callbacks to ActiveRecord that are called after transactions either commit or rollback on all records saved or destroyed in the transaction."
This reverts commits d2a49e4b1f and da840d13da.

[#2991]

Conflicts:

	activerecord/CHANGELOG
	activerecord/lib/active_record/transactions.rb
	activerecord/test/cases/transaction_callbacks_test.rb
2010-06-08 14:56:08 -04:00
Ernie Miller
a4eaa1fd39 Fix multiple self-referencing eager loads failing to join multiple times
[#4679 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-08 01:02:19 -04:00
wycats
b97a3f33a3 Merge remote branch 'rsim/oracle_enhanced_rails3' 2010-06-07 23:03:59 -04:00
Santiago Pastorino
94ed39d146 This test shouldn't rely on the order of the data returned by select
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-07 20:06:31 -04:00
José Valim
a04060fb6f Really make include_root_in_json default to true [#3770 state:resolved] 2010-06-08 01:02:45 +02:00
Carlos Antonio da Silva
7eedc3f397 Fixing test class names and refactor line in autosave association
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-07 10:45:47 +02:00
Xavier Noria
67a43554f1 removes Array#random_element and backports Array#sample from Ruby 1.9, thanks to Marc-Andre Lafortune 2010-06-05 01:15:17 +02:00
Raimonds Simanovskis
acef8feafa compare sorted arrays in relations_test
Oracle does not guarantee that SELECT will return records ordered by primary key
2010-06-04 22:58:55 +03:00
Raimonds Simanovskis
b0fdd290f4 fix test_belongs_to_with_primary_key_joins_on_correct_column test on Oracle 2010-06-04 22:44:04 +03:00
Raimonds Simanovskis
05ef038bb9 Fixed adapter tests not to assert LIMIT and OFFSET in SQL strings
Fixed adapter test cases that were failing in oracle because the asserts were looking for the presence of offset and limit which are not available in oracle. Changed the tests to check that the sql injection is not present in the output so that the tests are database adapter agnostic.
2010-06-04 22:44:03 +03:00
Raimonds Simanovskis
c6d6b50166 ignore selects from data dictionary views when running tests on Oracle 2010-06-04 22:44:03 +03:00
Raimonds Simanovskis
a82e067091 assert log output match in case insensitive mode to avoid failure when quoted table name is in uppercase (when using Oracle) 2010-06-04 22:44:03 +03:00
Raimonds Simanovskis
464b7f3ddc test fixes for Oracle enhanced adapter:
latest oracle_enhanced adapter does automatic shortening of index names
ignore select from all_triggers table in assert_queries
2010-06-04 22:44:03 +03:00
Raimonds Simanovskis
9bf7b6334f do order by id when finding first fixture to ensure that it is correct one
(as otherwise was failing under JRuby and oracle_enhanced adapter)
2010-06-04 22:44:02 +03:00
Raimonds Simanovskis
f12f377680 Oracle enhanced adapter now supports shortening of default generated index names, some additional tests now pass 2010-06-04 22:44:02 +03:00
Raimonds Simanovskis
6356a48faa Reduced size of table name prefix and suffix in migrations test as in Oracle identifier name cannot be larger than 30 characters 2010-06-04 22:44:02 +03:00
Raimonds Simanovskis
8136230cca Explicitly set Topic model last_read attribute as Date value when Oracle enhanced adapter is used
(otherwise some tests are failing which assume that this attribute will have Date value)
2010-06-04 22:44:02 +03:00
Raimonds Simanovskis
eec90bab28 create DateTime value with local offset as later it is compared to Time value with local offset
(otherwise test is failing for oracle_enhanced JDBC adapter)
2010-06-04 22:44:02 +03:00