Diego Carrion
72f37bd8bc
renderer calls object.to_json when rendering :json => object [ #5655 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-27 23:11:29 +02:00
Neeraj Singh
4966b915fe
Fix for #5579 involved the code change for both has_one and has_many relationships. The path included test only for has_one. This patch adds test for has_many relationship.
...
[#5706 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-27 23:11:26 +02:00
Neeraj Singh
7f743233c4
Fix for nested_attributes with has_many association fails when a single record is being updated.
...
[#5705 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-27 23:11:24 +02:00
Matthijs Langenberg
67a838574b
Fix broken module namespacing in ActiveResource with Ruby 1.9 [ #5699 state:resolved]
...
Following namespace use case was broken with Ruby 1.9:
class Author < ActiveRecord::Base
...
end
module Api
class Book < ActiveResouce::Base
end
end
Let's say XML contains <book><author><name>John</name></author>....
Api::Book.first.author.class.to_s #=>
Ruby 1.8.7: "Api::Book::Author" (namespaced, correct),
Ruby 1.9: "Author" (toplevel, broken)
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-27 23:10:55 +02:00
José Valim
dd83140b24
Properly initialize variables inside the initialize method.
2010-09-27 22:58:31 +02:00
Emilio Tagua
8adb24016d
Define @_routes inside method, makes more sense and will be initialized when called anywhere.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-27 16:43:33 -03:00
Emilio Tagua
1ab2ab07b5
Remove more warnings shadowing outer local variable.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-27 16:43:17 -03:00
Emilio Tagua
2f326b7f27
Remove warning "URI.unescape is obsolete" from actionpack.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-27 16:43:04 -03:00
José Valim
8be911c698
Merge remote branch 'gramos/ares-missing-prefix-value'
2010-09-27 21:33:03 +02:00
José Valim
8aa3684e07
Do not cache the script name outcome.
2010-09-27 21:14:18 +02:00
José Valim
fe0251e408
Merge remote branch 'miloops/warnings'
...
Conflicts:
actionpack/lib/action_controller/metal/url_for.rb
2010-09-27 21:00:54 +02:00
José Valim
6067d16200
Call it compile_methods! and do the same on AM.
2010-09-27 20:43:56 +02:00
Aaron Patterson
e1b51955f1
adding a test for slug behavior
2010-09-27 11:33:35 -07:00
Gaston Ramos
f85b38a36b
- added mock to test ActiveResource::MissingPrefixParam in finder_test
2010-09-27 15:25:44 -03:00
Gaston Ramos
e405dbcb48
- update exceptions documentation
2010-09-27 15:25:39 -03:00
Gaston Ramos
823a8e6e66
- check prefix options in collection_path
2010-09-27 15:25:33 -03:00
Gaston Ramos
9363931f34
- better name for prefix param test case
2010-09-27 15:25:28 -03:00
Gaston Ramos
30fb3638cc
- refactoring, move prefix_options check to a custom method
2010-09-27 15:25:23 -03:00
Gaston Ramos
a71e07d61e
- elmenth_path raise an ActiveResource::MissingPrefixParam exception when prefix_options does not has all required prefix_options ex: class StreetAddress < ActiveResource::Base self.site = " http://37s.sunrise.i:3000/people/:person_id/ " end
...
StreetAddress.element_path(1)
# => ActiveResource::MissingPrefixParam
2010-09-27 15:25:16 -03:00
José Valim
756b32ef39
Merge remote branch 'thedarkone/performance'
2010-09-27 20:10:04 +02:00
Neeraj Singh
fbd1d306b9
Three performance improvements:
...
* for simple cases like User.last and User.order('name desc').last no need to perform Array#join operation.
* Instead of performing String#blank? do Array#empty?
* no need to create variable relation
2010-09-27 10:49:49 -07:00
Aaron Patterson
e3d6434dd9
depending on arel 2.0.0
2010-09-27 09:27:39 -07:00
thedarkone
9c57bd8578
Fix Namind#model_name.
2010-09-27 17:46:00 +02:00
thedarkone
dc09cc055a
Assume compute_asset_host returns reasonable values.
2010-09-27 17:46:00 +02:00
thedarkone
bb47927d91
Convert unless/else into if/else.
2010-09-27 17:46:00 +02:00
thedarkone
b127e0cac9
Performance: refactor convert_options_to_data_attributes.
2010-09-27 17:46:00 +02:00
thedarkone
dcabc6c043
Remove dead code.
2010-09-27 17:46:00 +02:00
thedarkone
7d9f605f80
Clean up url_for.
2010-09-27 17:45:59 +02:00
thedarkone
5b81d1f3ef
Hash#empty? is faster than Enumerable#any? when used on a Hash.
2010-09-27 17:45:59 +02:00
thedarkone
70357666bc
Do a single string interpolation.
2010-09-27 17:45:59 +02:00
thedarkone
e1bccc5169
Simple .empty? test will do fine here (rails_asset_id returns nice strings).
2010-09-27 17:45:59 +02:00
thedarkone
7cee1587f1
options[:action] is very likely to be nil.
2010-09-27 17:45:59 +02:00
thedarkone
77efc20a54
Make assert_valid_keys slightly faster.
2010-09-27 17:45:59 +02:00
thedarkone
4c360c15e5
No need for an extra wrapper array.
2010-09-27 17:45:59 +02:00
thedarkone
e12e2fb4f6
Cache 2 of Request's commonly called methods.
2010-09-27 17:45:59 +02:00
thedarkone
8fdb34b237
Cache url_options on a per-request basis.
2010-09-27 17:45:59 +02:00
thedarkone
86bcccf8df
No need to create a separate lambda for each call.
2010-09-27 17:45:59 +02:00
thedarkone
7b2d51817d
Make asset extension rewriting faster.
2010-09-27 17:45:58 +02:00
thedarkone
05e53b4c1a
Optimize relative_url_root rewriting code.
2010-09-27 17:45:58 +02:00
thedarkone
f2e0b3575e
Use native attr_* macros for performance reasons.
2010-09-27 17:45:58 +02:00
thedarkone
320382ccd3
Creating singleton class for every object whenever the instance-level accessor is used quite is expensive.
2010-09-27 17:45:58 +02:00
thedarkone
5a518487fe
Try to use Hash's native #[] for speed.
2010-09-27 17:45:58 +02:00
thedarkone
8cda132136
Make InheritableOptions's constructor more flexible.
2010-09-27 17:45:58 +02:00
thedarkone
918dc27345
Compile ActionController::Base.config's methods to avoid method_missing overhead.
2010-09-27 17:45:58 +02:00
Emilio Tagua
50decfbc0e
_routes must be inside @controller conditional.
2010-09-27 11:19:24 -03:00
Emilio Tagua
023c2020b3
Initialize @_routes if not defined yet, avoiding more warnings.
2010-09-27 11:19:24 -03:00
Emilio Tagua
bb71f182dd
Rename duplicated test name.
2010-09-27 11:19:24 -03:00
Emilio Tagua
c2940a6bf4
Refactor method to avoid warnings and not run unnecessary code.
2010-09-27 11:19:24 -03:00
Emilio Tagua
d0621fde88
Avoid uninitialized variable warning.
2010-09-27 11:19:24 -03:00
Emilio Tagua
d95a16c526
Initialize @_request and @_response.
2010-09-27 11:19:23 -03:00