Aaron Patterson
61355c0e24
clearing up many warnings, removing unnecessary regular expresion comparisons [ #4365 state:resolved]
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-04-10 22:13:42 -07:00
mfoster
5850edf104
Made arrays of ActiveRecords, and any classes, with namespaces convert to valid xml. [ #3824 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-04-10 18:12:43 +02:00
Aaron Patterson
f46dc9b6b7
clear the rest of the warnings, run with warnings turned on [ #4332 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-04-10 13:50:38 +02:00
Aaron Patterson
922e4c57a4
kill warnings on 1.8.7 [ #4331 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-04-10 13:50:35 +02:00
Michael Koziarski
1e3dce08e1
Revert "When creating database with rake, create schemas in schema_search_path if it doesn't exist."
...
This reverts commit 6c2a0675f1 .
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
2010-04-09 11:30:40 +12:00
Kristopher Murata
36129f21b8
Dirty datetime attributes should be aware of time zone info [ #3658 state:resolved]
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-04-08 10:26:16 -07:00
Pratik Naik
48634bf59a
Reset named scope cache whenever the @target is reset
2010-04-07 01:16:45 +01:00
Pratik Naik
1f7b4447a9
Memoize association.named_scope calls
2010-04-05 21:55:24 +01:00
Andrew White
98b4424141
Add tests to prevent regression of lazy evaluation of has_many ..., :dependent => :___
...
[#2627 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-04-04 07:00:24 -07:00
Pratik Naik
b77dd218ce
Add Relation extensions
2010-04-02 17:38:02 +01:00
Ernie Miller
98bf00d50d
Add tests for postgresql column type mapping updates [ #4270 state:resolved]
...
Signed-off-by: Emilio Tagua <miloops@gmail.com >
2010-03-31 19:22:54 -03:00
Pratik Naik
5562abb4e9
Dont try to load the record from the db if preloading didn't find anything
2010-03-31 12:56:09 +01:00
Emilio Tagua
37102a5237
Fix failing test in MySQL.
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-03-30 16:01:53 +02:00
Emilio Tagua
8d99ec9a4d
Named scopes shouldn't test equality using to_a if it's not an Array, this was causing records to be loaded before they were needed.
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-03-30 15:36:18 +02:00
José Valim
56bed512f9
Fix dom_id for ActiveRecord [ #4296 state:resolved]
2010-03-30 01:32:26 +02:00
Ernie Miller
63026541b2
Fix honoring :primary_key option when joining or eager loading a belongs_to association
...
[#765 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-03-29 15:24:27 -07:00
Emilio Tagua
53ddbfc460
Warn scoped order and limit are ignored. [ #4123 state:resolved]
2010-03-29 11:30:06 -03:00
Andrew White
67d1cec4c8
Add the ability to specify table_name_prefix on individual modules
...
Signed-off-by: wycats <wycats@gmail.com >
2010-03-28 23:43:28 -07:00
Matthew Rudy Jacobs
b0967cc5cf
defining a named_scope which overwrites an existing method is now allowed we 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 >
2010-03-28 13:53:20 -07:00
Rizwan Reza
f1e5a9ff98
Add :dependent = to has_one and has_many [ #3075 state:resolved]
2010-03-28 18:47:46 +04:30
Rizwan Reza
6c2a0675f1
When creating database with rake, create schemas in schema_search_path if it doesn't exist.
2010-03-28 11:01:15 +04:30
José Valim
ff522cf4bc
Revert "primary_key now supports :limit for MySQL". Break Sam Ruby app.
...
To reproduce, start a new application, create a scaffold and run test suite. [#876 state:open]
This reverts commit faeca694b3 .
2010-03-27 14:39:43 +01:00
Rizwan Reza
faeca694b3
primary_key now supports :limit for MySQL
...
Signed-off-by: wycats <wycats@gmail.com >
2010-03-27 03:49:53 -07:00
José Valim
0cb3311d06
Revert "primary_key now supports :limit. [ #876 state:resolved]" since it broke AR test suite.
...
This reverts commit 41e5c7ed44 .
2010-03-27 11:05:37 +01:00
Rizwan Reza
41e5c7ed44
primary_key now supports :limit. [ #876 state:resolved]
...
Signed-off-by: wycats <wycats@gmail.com >
2010-03-27 01:33:42 -07:00
Pratik Naik
68ade93cde
Revert "Changed behavior of touch and added touch! Originally implemented by Obie Fernandez, updated touch! to act as a thin wrapper to touch. [ #2520 state:resolved]"
...
This reverts commit 3a875e6184 .
2010-03-27 08:22:32 +00:00
Nathaniel Bibler
3a875e6184
Changed behavior of touch and added touch! Originally implemented by Obie Fernandez, updated touch! to act as a thin wrapper to touch. [ #2520 state:resolved]
...
Signed-off-by: wycats <wycats@gmail.com >
2010-03-27 00:35:39 -07:00
Kris Selden
afb786ad8a
In PostgreSQLAdapter, switch tables query to use current_schemas function [ #918 state:resolved]
...
Signed-off-by: wycats <wycats@gmail.com >
2010-03-26 17:18:33 -07:00
Emilio Tagua
e3a2fae05d
Add add_limit_offset! to adapters.
2010-03-25 12:37:38 -03:00
Aaron Patterson
ed21f0c502
expand migration paths before requiring them. [ #4240 state:resolved]
...
Signed-off-by: wycats <wycats@gmail.com >
2010-03-23 18:22:46 -07:00
Aaron Patterson
bc48d39e4c
do not use unloadable constants in tests [ #4260 state:resolved]
...
Signed-off-by: wycats <wycats@gmail.com >
2010-03-23 18:02:29 -07:00
Evan Phoenix
4f5de7f89a
Reset class attribute after changing it
2010-03-22 10:00:04 -07:00
Evan Phoenix
0b608abeb8
Clear the query cache between tests that test the query cache
2010-03-22 10:00:04 -07:00
Evan Phoenix
79b0861624
Remove obsolete use case that was broken in AR::Observers
2010-03-22 10:00:04 -07:00
Evan Phoenix
a307fd6bd3
Don't depend on order of elements in Set
2010-03-22 10:00:03 -07:00
Evan Phoenix
34497c0b36
Remove test ordering bug by using another class
2010-03-22 10:00:03 -07:00
Aaron Patterson
3911a7c197
squelching more warnings in the AR tests. [ #4218 state:resolved]
...
Signed-off-by: wycats <wycats@gmail.com >
2010-03-18 10:24:16 -07:00
Aaron Patterson
dcf1441c0f
removing dead code from activerecord tests. [ #4187 state:resolved]
...
Signed-off-by: wycats <wycats@gmail.com >
2010-03-15 18:36:08 -07:00
Aaron Patterson
1def14309f
cleaning up a bunch of parse time warnings in AR [ #4186 state:resolved]
...
Signed-off-by: wycats <wycats@gmail.com >
2010-03-15 18:22:31 -07:00
Jeremy Kemper
1f2738261f
Hack to keep column metadata queries out of test query counts
2010-03-15 13:56:19 -07:00
Jeremy Kemper
30f5f95544
Hack to keep column metadata queries out of test query counts
2010-03-15 11:00:25 -07:00
Xavier Noria
c8f1aac761
restricts a test to < 1.9, and rewrites it using a proper expectation
...
Signed-off-by: wycats <wycats@gmail.com >
2010-03-13 17:04:08 -06:00
Xavier Noria
89eae2d187
adds coverage for the issue addressed in fe43bbd
...
[#4166 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-03-12 13:22:47 -08:00
Carlos Antonio da Silva
47d252f992
Fix associations to call :destroy or :delete based on the right :dependent option
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-03-09 00:11:34 +01:00
wycats
39d6f9e112
Make many parts of Rails lazy. In order to facilitate this,
...
add lazy_load_hooks.rb, which allows us to declare code that
should be run at some later time. For instance, this allows
us to defer requiring ActiveRecord::Base at boot time purely
to apply configuration. Instead, we register a hook that should
apply configuration once ActiveRecord::Base is loaded.
With these changes, brings down total boot time of a
new app to 300ms in production and 400ms in dev.
TODO: rename base_hook
2010-03-07 06:24:30 -08:00
Carl Lerche
0de3b9ec93
Somehow this fixes the AR tests when ran with rake. I should probably figure out why.
2010-03-04 02:20:01 -08:00
Carl Lerche
07b5146442
Fix active_records' log tests
2010-03-02 23:01:31 -08:00
Joshua Peek
5cc17da894
activerecord test load paths
2010-02-28 18:28:25 -06:00
José Valim
f3839b2b99
ActiveRecord should raise an error on invalid migration types.
2010-02-28 11:53:48 +01:00
Tobias Bielohlawek
4db72b702f
fixed a 'RecordNotFound' bug when calling 'reload' on a object which doesn't met the default_scope conditions, added test [ #3166 status:resolved]
...
The reload method didn't made use of 'with_exclusive_scope' when reloading the object. This lead to a RecordNotFound exception, in case the object doesn't met the default_scope condition (anymore) - which is obviously a bug. This quick fix makes use of with_exclusive_scope in the reload method as well. See test for full example.
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-02-26 11:14:16 +01:00