Akira Matsuda
cb9fa52832
auto_link: avoid recognizing full width chars as a part of URI scheme
...
fixes regression by 133ada6ab0
[#5503 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-02-01 14:04:42 -02:00
Akira Matsuda
8a85f64abf
Accept 'postgres' as a PostgreSQL driver name in dbconsole for non-AR ORMs like DataMapper and Sequel
...
[#6180 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-02-01 13:20:53 -02:00
Akira Matsuda
5dd803e9b1
Accept String value for render_partial :as option
...
[#6222 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-02-01 13:01:54 -02:00
Glenn Vanderburg
6bd9fac1e3
Propagate association extensions to scopes called on the association.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-02-01 12:38:58 -02:00
Akira Matsuda
817e370136
Make before_type_cast available for datetime fields
...
[#3973 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-02-01 12:21:18 -02:00
geemus
ed2eb6fa87
updating Gemfile with more contemporary example
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-01-31 21:12:52 -02:00
Aaron Patterson
4ccf8319bb
expand mulasgn for enhancing readability
2011-01-31 14:03:28 -08:00
Akira Matsuda
2e11213d62
"rails dbconsole t" must not load "production" but "test"
...
[#6293 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-01-31 19:48:58 -02:00
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