Commit Graph

20591 Commits

Author SHA1 Message Date
John Firebaugh
57bc25c5f8 Use run_callbacks; the generated _run_<name>_callbacks method is not a public interface.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-01-31 19:45:53 -02:00
Pratik Naik
9666b6a625 Run BulkAlterTableMigrationsTest only when the adapter supports them 2011-01-31 14:10:51 +00:00
Pratik Naik
30176f28a4 Add :bulk => true option to change_table 2011-01-31 13:21:25 +00:00
Jon Leighton
9db4c07e0b Make use of helpers in AssociationReflection 2011-01-30 11:58:09 +00:00
Jon Leighton
3fa61ccb9e Has many through - It is not necessary to manually merge in the conditions hash for the through record, because the creation is done directly on the through association, which will already handle setting the conditions. 2011-01-30 11:58:09 +00:00
Jon Leighton
c5e912a8b3 @join_table_name is no longer used 2011-01-30 11:58:09 +00:00
Jon Leighton
59d54c3eba Make AssociationCollection#include? a bit more readable 2011-01-30 11:58:08 +00:00
Jon Leighton
0645fd2c80 Don't use method_missing when we don't have to 2011-01-30 11:58:08 +00:00
Jon Leighton
2e24cf7cc2 AssociationCollection#clear can basically just use #delete_all, except it should return self. 2011-01-30 11:58:08 +00:00
Jon Leighton
88df88095c AssociationCollection#to_ary should definitely dup the target! Also changed #replace which was previously incorrect, but the test passed due to the fact that to_a was not duping. 2011-01-30 11:58:08 +00:00
Jon Leighton
1da1ac159f Just use primary_key here, AR::Relation will resolve the ambiguity before it is converted to SQL 2011-01-30 11:58:08 +00:00
Jon Leighton
140b269fb7 Call sum on the scope directly, rather than relying on method_missing and calculate 2011-01-30 11:58:08 +00:00
Jon Leighton
ca7785847e Condense first_or_last a bit more 2011-01-30 11:58:08 +00:00
Jon Leighton
fdee153ff8 Get rid of separate reset_target! and reset_scopes_cache! methods 2011-01-30 11:58:08 +00:00
Jon Leighton
5dd3dadcdd target is always an array 2011-01-30 11:58:08 +00:00
Jon Leighton
47309826e4 load_target will return the target. it also will not load if loaded? is true. 2011-01-30 11:58:08 +00:00
Jon Leighton
b7bcc7e190 DRY up first/last and hence make last benefit from the bugfix in first 2011-01-30 11:58:08 +00:00
Jon Leighton
e8d7152a89 Use scoped.find directly rather than having a find_by_sql method 2011-01-30 11:58:07 +00:00
Jon Leighton
1a4bbaf106 Use scoped.first and scoped.last instead of find(:first, ...) and find(:last, ...) 2011-01-30 11:58:07 +00:00
Jon Leighton
1e7cf6c7e9 Try to make fetch_first_or_last_using_find? more readable 2011-01-30 11:58:07 +00:00
Jon Leighton
db503c4142 load_target returns the target 2011-01-30 11:56:41 +00:00
Jon Leighton
aa86420be2 Rename AssociationProxy#loaded to loaded! as it mutates the association 2011-01-30 11:56:41 +00:00
Jon Leighton
de05e2fb15 Abstract load_target conditional logic 2011-01-30 11:56:41 +00:00
Jon Leighton
d392c67d2c Remove unused methods conditions, sql_conditions and sanitize_sql 2011-01-30 11:56:41 +00:00
Jon Leighton
dbb6fa723e Don't pass around conditions as strings in ThroughAssociation 2011-01-30 11:56:41 +00:00
Jon Leighton
d85ee50eda Indent methods under private/protected sections 2011-01-30 11:56:41 +00:00
Jon Leighton
15601c52e7 Let's be less blasé about method visibility on association proxies 2011-01-30 11:56:41 +00:00
Jon Leighton
63c73dd021 We shouldn't be using scoped.scoping { ... } to build associated records, as this can affect validations/callbacks/etc inside the record itself [#6252 state:resolved] 2011-01-30 11:56:41 +00:00
Mikel Lindsaar
8adfede96e Merge branch 'fix-gitignore' of https://github.com/telemachus/rails into telemachus-fix-gitignore 2011-01-30 00:06:03 +11:00
Philip Arndt
99f751ffef Test non zero exit code and that a message still appears when generating inside an existing Rails directory. 2011-01-29 16:51:42 +08:00
Philip Arndt
a812cb6707 Dir.chdir is not useful in this test, that was for another one I am planning to do. 2011-01-29 16:51:41 +08:00
Philip Arndt
34fef7e258 Added test to ensure non zero exit codes when generating an application with a reserved name.
Unfortunately, I can't find out how to suppress its output so we see ....Invalid application name test. Please give a name which does not match one of the reserved rails words.....................................
2011-01-29 16:51:41 +08:00
Philip Arndt
d6fd5821da Exit with non-zero to signal failure. 2011-01-29 16:51:40 +08:00
Philip Arndt
e0b16debd1 Use exit(1) instead of exit(false) 2011-01-29 16:51:40 +08:00
Philip Arndt
dcc72b2079 Use Thor's self.exit_on_failure? to exit whenever accessing the generators from the CLI and a Thor::Error is raised. 2011-01-29 16:51:39 +08:00
Philip Arndt
36f570dbd2 Apply exit code 1 when commands don't succeed so that other libraries can properly detect the failure. 2011-01-29 16:51:38 +08:00
Aaron Patterson
740bc35d32 always return the identity function from type_cast_code 2011-01-28 18:04:22 -08:00
Aaron Patterson
72c1818941 use an identity conversion to avoid conditional codes 2011-01-28 17:39:38 -08:00
Alexey Nayden
fa779c5357 Fixing incorrectly writtent testcase 2011-01-28 15:06:02 -08:00
Alexey Nayden
e92c2ffd8e Nested attributes and in-memory changed values #first and #[] behaviour consistency fix 2011-01-28 15:06:01 -08:00
Alexey Nayden
2884482c34 test_first_and_array_index_zero_methods_return_the_same_value_when_nested_attributes_are_set_to_update_existing_record added 2011-01-28 15:06:01 -08:00
Aaron Patterson
c87fb22a06 make sure we play nicely when syck is activated 2011-01-28 15:00:52 -08:00
brainopia
eb33bd944d Psych correctly gets visitor for SafeBuffer from superclass 2011-01-28 14:32:53 -08:00
brainopia
452dba72f5 Remove unneeded yaml_as declaration 2011-01-28 14:31:36 -08:00
Aaron Patterson
c29eef7da7 load psych by default if possible 2011-01-28 14:24:11 -08:00
Santiago Pastorino
e19a7729d1 Bump mail version up 2011-01-28 17:45:11 -02:00
Neeraj Singh
806e6f80dc render_to_string must ensure that response_body
is nil

[ #5875 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2011-01-25 20:14:03 +01:00
Neeraj Singh
c1145d9281 If I want to set respond_body to nil then it
should be nil and not [nil]. If anything other
than nil then wrap it in array

Signed-off-by: José Valim <jose.valim@gmail.com>
2011-01-25 20:13:56 +01:00
Doug Fales
7927fc2ff7 A patch so that http status codes are still included in logs even during an exception [#6333 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-01-25 20:12:22 +01:00
Aaron Patterson
59f3218463 load and prefer psych as the YAML parser when it is available 2011-01-21 17:53:28 -08:00