Commit Graph

18641 Commits

Author SHA1 Message Date
Aaron Patterson
b7934afe32 use new skool Ruby instead of Ruby Classic™ 2010-09-27 18:55:28 -07:00
Aaron Patterson
7752b2fa62 be kind to the garbage collector: only instantiate objects when absolutely necessary 2010-09-27 18:07:35 -07:00
Aaron Patterson
526ade1ff6 adding test cases for the dynamic finder matcher match method 2010-09-27 17:59:28 -07:00
Aaron Patterson
65d74312c8 constructor should not do so much work; avoid allocating object if possible 2010-09-27 17:38:49 -07:00
Aaron Patterson
133742d185 @klass also uses DynamicFinderMatch, so no need for it on the relation 2010-09-27 16:51:12 -07:00
Aaron Patterson
b1f5e90839 no need for a case / when statement 2010-09-27 16:20:46 -07:00
Aaron Patterson
f6ef4d383e do not need intermediate variable, avoid lasgn 2010-09-27 16:20:46 -07:00
Aaron Patterson
ff5b3f5c3a DRY up our regular expression 2010-09-27 16:20:46 -07:00
Aaron Patterson
9e652b65c2 reduce method calls in the dynamic finder matcher 2010-09-27 16:20:46 -07:00
José Valim
8aa86babad Fix tests on 1.9.2. 2010-09-28 00:39:29 +02:00
Xavier Noria
dc5336e7f4 revises RDoc of Hash#to_param to be more precise about ordering 2010-09-28 00:36:53 +02:00
Xavier Noria
10dec0e65e let Hash#to_param and Hash#to_query sort again
This was a regression introduced in 5c85822008. We bring
sorting back because people rely on it, eg for constructing consistent cache keys.
2010-09-28 00:32:20 +02:00
Aaron Patterson
f22b40a8f2 make sure we use the engine assigned to the table when quoting 2010-09-27 14:29:07 -07:00
Neeraj Singh
bfc986811c Test for after_create callback order in ActiveSupport [#5703 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-27 23:12:10 +02:00
Neeraj Singh
72c1e19c33 after_create in ActiveModel should in the order specified
[#5650 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-27 23:11:31 +02:00
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