Commit Graph

1278 Commits

Author SHA1 Message Date
Jan De Poorter
db116a2ed6 Fix NamedScope regex so methods containing "an" get delegated to proxy_found. [#901 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-08-29 14:06:37 +01:00
Andrew White
db22c89543 Merge scoped :joins together instead of overwriting them. May expose scoping bugs in your code!
[#501 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-08-28 12:07:15 -07:00
Ernie Miller
44af2efa2c Refactored AssociationCollection#count for uniformity and Ruby 1.8.7 support.
[#831 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-08-28 11:58:25 -07:00
Tarmo Tänav
96c6fe0842 Implement count limit/offset support for has_many associations
[#348 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-08-27 23:32:21 -07:00
Tarmo Tänav
13671cc565 Alias included associations if needed when doing a count
[#302 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-08-27 23:29:29 -07:00
Tom Lea
ad562c58ea Dirty: treat two changes resulting in the original value as being unchanged.
[#798 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-08-27 23:13:41 -07:00
Jeremy Kemper
657898c821 Merge commit 'sven/i18n'
Conflicts:
	activesupport/lib/active_support.rb
2008-08-27 12:31:07 -07:00
pivotal
9dbde4f5cb Fix two has_one :through errors
* Set the association target on assignment;
* Reset target to nil on reset, rather than empty array.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#895 state:committed]
2008-08-27 11:22:15 +02:00
Marko Seppae
2d03a4c668 i18n: fixed failing tests after removing #populate and #store_translations 2008-08-27 10:37:01 +02:00
Tarmo Tänav
eec5eb2e44 Fix yet another implicit order dependant test
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-08-26 13:16:55 +02:00
Tarmo Tänav
ce3c76de7c Just look at sql_type when testing that the correct database-specific type was used
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-08-26 12:11:01 +02:00
Jeremy Kemper
ab1e82b8f7 Include people and readers fixtures to fix test isolation error 2008-08-26 02:38:48 -07:00
Jeremy Kemper
0c7bbc72fc fix tests relying on implicit ordering 2008-08-26 02:17:36 -07:00
Tarmo Tänav
973c0ef26d Create mysql binary_fields table with latin1 character set as with utf8 all the limits would have to be divided by 3 to get the expected text types
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-08-26 01:49:19 -07:00
Tarmo Tänav
fa795ccfad Include mysql older than 5.1.23 in the 5.1 series in the list of those that can't handle NULL defaults
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-08-26 00:53:19 -07:00
Jeremy Kemper
52e15abbed um.. yeah 2008-08-26 00:10:16 -07:00
Jeremy Kemper
6d66ddaa34 typo 2008-08-26 00:02:30 -07:00
Jeremy Kemper
842d55cb16 fix another ordering failure 2008-08-26 00:02:22 -07:00
Jeremy Kemper
ca48da6300 fix tests relying on implicit ordering 2008-08-25 23:53:31 -07:00
Josh Susser
1092c181b5 add dynamic finder bang version to raise RecordNotFound
[#905 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-08-25 23:33:16 -07:00
Josh Susser
143f5fbb21 refactor dynamic finder name matching into its own class
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-08-25 23:32:20 -07:00
Jeremy Kemper
3beed9cdb7 ensure tests load sibling Active Support instead of a gem 2008-08-25 23:32:03 -07:00
Tarmo Tänav
a445cdd884 Load the first and not the last has_one result when doing join-based eager loading
This matters when the has_one is defined with an order in which case
there is an expectation that the first one will be loaded.

[#904 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-08-25 21:23:35 -07:00
Frederick Cheung
2dbda11945 Implement old-skool eagerloading for has_one :through
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-08-25 21:23:15 -07:00
Frederick Cheung
b7a37b742c Fix preloading of has_one through associations
[#903 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-08-25 20:49:55 -07:00
Jeremy Kemper
e5cad34916 strip trailing whitespace 2008-08-25 18:16:58 -07:00
Jeremy Kemper
1c54ca4f75 Ruby 1.9 compat: fix test error masked by old String#each behavior 2008-08-25 18:16:21 -07:00
Sven Fuchs
49859b0bb1 I18n: fix activerecord i18n test for classy backend 2008-08-25 11:48:03 +02:00
Jeremy Kemper
950ea33242 Fix test to assign the module instead of a new instance 2008-08-24 11:08:49 -07:00
Michael Koziarski
33ed19f428 Merge branch 'patches' 2008-08-24 14:34:47 +02:00
Xavier Noria
e02f0dcc24 Rollback the transaction when a before_* callback returns false.
Previously this would have committed the transaction but not carried out save or destroy operation.

[#891 state:committed]
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-08-24 14:34:24 +02:00
Tarmo Tänav
74c3c701f7 Don't set "NULL" as a constraint on nullable columns [#398 state:resolved]
This is already the default and adding it breaks SQL standards compatibility.
2008-08-23 19:51:09 +03:00
Josh Susser
e48e77e022 coerce blank strings to nil values for boolean and integer fields
[#860 state:resolved]
2008-08-22 16:26:40 -07:00
Tarmo Tänav
707ee0e269 Made migrations transactional for PostgreSQL [#834 state:resolved]
Patch originally from http://dev.rubyonrails.org/ticket/5470
2008-08-22 14:46:25 -07:00
Jeremy Kemper
9dac5547ad Merge branch 'master' into i18n 2008-08-22 13:01:53 -07:00
Jeremy Kemper
a6e05b18d6 Merge commit 'sven/i18n' into i18n 2008-08-22 12:44:14 -07:00
Patrick Reagan
683ff235e6 Ensure t.timestamps respects options. [#828 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-08-22 12:48:00 +01:00
Tarmo Tänav
52ac9d0444 Fixed ordering in test_find_in_association_with_custom_finder_sql_and_multiple_interpolations 2008-08-22 10:39:45 +03:00
Jeremy Kemper
a5eb297424 Revert "coerce blank strings to nil values for boolean and integer fields"
This reverts commit aee14630d4.

[#860 state:incomplete]
2008-08-21 21:34:37 -07:00
S. Brent Faulkner
bbedb6a624 remember created records and select a random one instead of relying on sequential id values starting at 1
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-08-21 19:33:26 +02:00
Josh Susser
aee14630d4 coerce blank strings to nil values for boolean and integer fields
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-08-21 19:33:25 +02:00
Sven Fuchs
aad429a46e Merge branch 'master' into i18n 2008-08-21 19:04:39 +02:00
Iain Hecker
cf6840773b Custom error messages scope improved 2008-08-21 18:40:44 +02:00
Peter Wagenet
8622787f87 Don't interpret decimals as table names in ActiveRecord::Associations::ClassMethods#references_eager_loaded_tables? [#532 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-08-21 17:21:17 +01:00
Tom Lea
3724dafe71 Fix incorrect signature for NamedScope#respond_to? [#852 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-08-21 16:39:27 +01:00
Philip Hallstrom
49c0e1e594 Fix generated WHERE IN query for named scopes. [#583 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-08-21 16:11:28 +01:00
Xavier Noria
a970f916fb Fix has_many#count_records. [#865 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-08-21 15:48:04 +01:00
Jakub Kuźma
ea40f71431 Fix that has_one natural assignment to already associated record. [#854 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-08-21 15:21:21 +01:00
Ryan Bates
2415652660 Support find_all on named scopes. [#730 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-08-21 12:37:19 +01:00
Iain Hecker
febe2ea977 Locale file changed to yaml 2008-08-20 18:01:12 +02:00