Jon Leighton
f000d4e5fa
Quote these dates to prevent intermittent test failure. Suppose local time is 00:50 GMT+1. Without the quoting, the YAML parser would parse this as 00:50 UTC, into the local time of 01:50 GMT+1. Then, it would get written into the database in local time as 01:50. When it came back out the UTC date from the database and the UTC date of two weeks ago would be compared. The former would be 23:50, and the latter would be 00:50, so the two dates would differ, causing the assertion to fail. Quoting it prevents the YAML parser from getting involved.
2011-08-04 00:38:27 +01:00
Christopher Meiklejohn
43fc814074
Ensure that .up and .down work as well.
2011-08-02 18:57:34 -07:00
Christopher Meiklejohn
74d7bfb200
Support backwards compatible interface for migration down/up with rails 3.0.x.
2011-08-02 18:55:59 -07:00
Vishnu Atrai
624c4571fd
remove extra require for 'stringio' as it is required in helper.rb
2011-07-31 18:05:05 +05:30
José Valim
779d78d591
Merge pull request #2358 from arunagw/test_fix_187_skip
...
skiping magic comment test for < 1.9
2011-07-31 04:25:25 -07:00
Arun Agrawal
329409decd
magic comment test only if encoding_aware?.
2011-07-30 23:46:26 +05:30
Brian Cardarella
e7330f3d4f
Resolve warnings by instantizing @attrubtes as nil
2011-07-30 12:08:26 -04:00
Aaron Patterson
3d6e187255
dump IO encoding value along with schema.rb so the file can be reloaded. fixes #1592
2011-07-29 12:23:37 -07:00
Jon Leighton
971a74b81f
Revert "Merge pull request #2309 from smasry/master"
...
This reverts commit 9d396ee819 , reversing
changes made to fa2bfd832c .
Reason: the change broke the build.
2011-07-28 13:14:11 +01:00
Samer Masry
18d307ed94
Reverse order fix when using function for ActiveRecord::QueryMethods Fixes #1697
2011-07-27 10:17:25 -07:00
Dmitriy Kiriyenko
9a298a162c
Fixed failing query when performing calculation with having based on select.
2011-07-27 16:48:15 +03:00
Jon Leighton
24f0a872e6
Add a proxy_association method to association proxies, which can be called by association extensions to access information about the association. This replaces proxy_owner etc with proxy_association.owner.
2011-07-27 12:36:00 +01:00
Vishnu Atrai
1e69f0b84a
remove deprication warning: ambiguous first argument; put parentheses or even spaces
2011-07-26 23:39:17 +05:30
Piotr Sarnacki
14c6fca9cd
Revert "allow select to have multiple arguments"
...
This reverts commit 04cc446d17 .
I reverted it because apparently we want to use: select([:a, :b])
instead of select(:a, :b), but there was no tests for that form.
2011-07-26 16:15:12 +02:00
Piotr Sarnacki
89f3d8a886
Merge pull request #2271 from slawosz/enhance_select_method_api
...
allow select to have multiple arguments ie. Post.select(:id,:name,:author)
2011-07-26 06:33:54 -07:00
Sławosz Sławiński
04cc446d17
allow select to have multiple arguments
2011-07-26 14:57:47 +02:00
Franck Verrot
41902e6932
Simplify the test by using id and name. id will be the only real sort criteria in any case as it's unique.
2011-07-26 11:36:18 +02:00
Santiago Pastorino
64affc9384
Merge pull request #2236 from cldwalker/after_initialize
...
Fix after_initialize and Base.create edge case
2011-07-25 07:20:38 -07:00
thedarkone
10863580aa
Bring back the ability to provide :order for update_all.
2011-07-25 13:33:44 +02:00
Aaron Patterson
02691d3516
Merge pull request #2238 from cesario/order-with-extra-spaces
...
Ordering with extra spaces was raising a SQL exception
2011-07-24 14:40:15 -07:00
Gabriel Horner
f5e4d13270
use existing model for testing Base.create with #after_initialize
2011-07-24 16:36:06 -04:00
Xavier Noria
4bb0a8bcbd
Merge branch 'master' of git://github.com/lifo/docrails
2011-07-24 21:02:51 +02:00
Oemuer Oezkir
71d18ce48e
Changed a few instances of of words in the API docs written in British English to
...
American English(according to Weber)
2011-07-24 10:21:42 +00:00
Franck Verrot
77bb0b79f2
Ordering with extra spaces was raising a SQL exception
2011-07-24 08:18:04 +02:00
Gabriel Horner
6e3c0a5d9a
simplify and be more explicit about create and after_initialize tests
2011-07-24 00:31:37 -04:00
Les Fletcher
f956759f8a
fix after_initialize edge case ( close #2074 and close #2175 )
...
fix behavior when after_initialize is defined and a block is passed to Base.create
2011-07-24 00:31:28 -04:00
Xavier Noria
a62f450661
Merge pull request #2086 from amatsuda/date_multiparameter_nil
...
convert multiple Date parameters into a nil if any of its bits were blank
2011-07-23 11:20:12 -07:00
Aaron Patterson
253b472838
forgot to add this test case
2011-07-22 09:12:32 -07:00
Aaron Patterson
1a0b7ea3c9
adding more tests around database uri parsing
2011-07-21 12:57:05 -07:00
Aaron Patterson
f4ed975125
move around tests
2011-07-21 11:54:29 -07:00
Terence Lee
16921437a1
fix postgres connection url test
2011-07-20 16:23:31 -07:00
Glenn Gillen
16249feaab
Added test for postgres connections as URL. Fixed query param parsing.
2011-07-20 16:23:31 -07:00
Glenn Gillen
89357c8f83
Provide database connection settings as a URL.
2011-07-20 16:23:31 -07:00
Franck Verrot
8bc314b3b7
assign_nested_attributes_for_collection_association should work with Ruby 1.9 [ Closes #2106 ]
...
Children attributes can be either String's or Symbol's, so let's check if the object responds to to_i.
2011-07-20 15:40:01 -07:00
Aaron Patterson
d8736b266b
Revert "this fixes a brittle test in fixtures_test.rb which fails when you are in a timezone which is ahead of UTC but UTC is in the previous day still."
...
This reverts commit f92cefa95f .
2011-07-20 15:37:52 -07:00
Aaron Patterson
09a488456a
bigdecimal should be typecast to a float on sqlite3. fixes #2162
2011-07-20 14:39:01 -07:00
Josh Kalderimis
f92cefa95f
this fixes a brittle test in fixtures_test.rb which fails when you are in a timezone which is ahead of UTC but UTC is in the previous day still.
2011-07-20 01:00:35 +02:00
Elliot Winkler
0e1d617b8b
ActiveRecord: Fix eager loading so that giving a blank order clause generates valid SQL
2011-07-18 14:56:37 -06:00
José Valim
da144894e9
Merge pull request #195 from bigfix/active_model_include_serialization
...
ActiveModel support for the :include serialization option
2011-07-18 06:50:43 -07:00
Prem Sichanugrist
4443905169
Refactor test case to use anonymous class - Thank you @tenderlove
2011-07-18 00:37:06 -04:00
Prem Sichanugrist
6e6994994d
Raise an ArgumentError if user passing less number of argument in the dynamic finder
...
The previous behavior was unintentional, and some people was relying on it. Now the dynamic finder will always expecting the number of arguments to be equal or greater (so you can still pass the options to it.)
So if you were doing this and expecting the second argument to be nil:
User.find_by_username_and_group("sikachu")
You'll now get `ArgumentError: wrong number of arguments (1 for 2).` You'll then have to do this:
User.find_by_username_and_group("sikachu", nil)
2011-07-17 18:44:03 -04:00
Jon Leighton
ac97e25235
Revert "Fix failure in test_preserves_existing_fixture_data from test/cases/fixtures_test.rb when UTC and local time occur on different dates." I am pretty sure this was an incorrect fix, and it still failed in certain circumstances anyway. I am now unable to reproduce the original failure I was experiencing so will leave it for now and see if this pops up again.
...
This reverts commit e4479b2f1b .
2011-07-17 19:55:05 +01:00
John Firebaugh
1723a7a6c6
Move to_xml tests to xml_serialization_test.rb
...
One duplicate was eliminated: test_to_xml_including_methods/
test_methods_are_called_on_object.
2011-07-17 11:34:07 -07:00
Akira Matsuda
9cd1f754d0
convert multiple Date parameters into a nil if any of its bits were blank
2011-07-15 21:19:23 +09:00
Santiago Pastorino
31ea0276a4
Merge pull request #2063 from elight/master
...
Patch for https://github.com/rails/rails/issues/2059
2011-07-14 11:14:27 -07:00
Evan Light
f13dea8a34
Fix and unit test for https://github.com/rails/rails/issues/2059
...
Cache key was incorrectly using timezone-dependent record#updated_at when it should be using a timezone-independent value to generate the cache key
Minor refactoring to cache_key timezone test
Closes #2059
Adds a test to validate the format of the cache_key for nil and present updated_at values
Correctly handles updated_at == nil
2011-07-14 14:04:02 -04:00
Santiago Pastorino
d632e927ec
Merge pull request #1807 from caius/find_in_batches_id_bug
...
Bugfix by stopping find_in_batches using the records after yielding.
2011-07-14 07:57:04 -07:00
Jon Leighton
e4479b2f1b
Fix failure in test_preserves_existing_fixture_data from test/cases/fixtures_test.rb when UTC and local time occur on different dates.
2011-07-12 00:14:45 +01:00
Jon Leighton
1712d90050
Fix exception if old and new targets are both nil. Fixes #1471 .
2011-07-12 00:14:45 +01:00
Santiago Pastorino
539d684b7a
Merge pull request #1929 from sobrinho/master
...
Create a test case for disable_referential_integrity
2011-07-11 06:00:59 -07:00