Ticket #7319: small_actioncontroller_doc_fixes_and_additions.diff
| File small_actioncontroller_doc_fixes_and_additions.diff, 4.7 kB (added by jeremymcanally, 2 years ago) |
|---|
-
actionpack/lib/action_controller/base.rb
old new 535 535 self.class.controller_path 536 536 end 537 537 538 # Test whether the session is enabled for this request. 538 539 def session_enabled? 539 540 request.session_options[:disabled] != false 540 541 end -
actionpack/lib/action_controller/url_rewriter.rb
old new 76 76 alias_method :to_s, :to_str 77 77 78 78 private 79 # Given a path and options, returns a rewritten URL string 79 80 def rewrite_url(path, options) 80 81 rewritten_url = "" 81 82 unless options[:only_path] … … 91 92 rewritten_url 92 93 end 93 94 95 # Given a Hash of options, generates a route 94 96 def rewrite_path(options) 95 97 options = options.symbolize_keys 96 98 options.update(options[:params].symbolize_keys) if options[:params] -
actionpack/lib/action_controller/assertions/routing_assertions.rb
old new 66 66 end 67 67 68 68 private 69 # Recognizes the route for a given path. 69 70 def recognized_request_for(path, request_method = nil) 70 71 path = "/#{path}" unless path.first == '/' 71 72 -
actionpack/lib/action_controller/assertions/response_assertions.rb
old new 119 119 end 120 120 121 121 private 122 # Recognizes the route for a given path. 122 123 def recognized_request_for(path, request_method = nil) 123 124 path = "/#{path}" unless path.first == '/' 124 125 … … 131 132 request 132 133 end 133 134 135 # Proxy to to_param if the object will respond to it. 134 136 def parameterize(value) 135 137 value.respond_to?(:to_param) ? value.to_param : value 136 138 end -
actionpack/lib/action_controller/assertions/dom_assertions.rb
old new 1 1 module ActionController 2 2 module Assertions 3 3 module DomAssertions 4 # test 2 html strings to be equivalent, i.e. identical up to reordering of attributes4 # Test two HTML strings for equivalency (e.g., identical up to reordering of attributes) 5 5 def assert_dom_equal(expected, actual, message="") 6 6 clean_backtrace do 7 7 expected_dom = HTML::Document.new(expected).root … … 11 11 end 12 12 end 13 13 14 # negated form of +assert_dom_equivalent+14 # The negated form of +assert_dom_equivalent+. 15 15 def assert_dom_not_equal(expected, actual, message="") 16 16 clean_backtrace do 17 17 expected_dom = HTML::Document.new(expected).root -
actionpack/lib/action_controller/assertions/model_assertions.rb
old new 1 1 module ActionController 2 2 module Assertions 3 3 module ModelAssertions 4 # ensures that the passed record is valid by active record standards. returns the error messages if not4 # Ensures that the passed record is valid by ActiveRecord standards and returns any error messages if it is not. 5 5 def assert_valid(record) 6 6 clean_backtrace do 7 7 assert record.valid?, record.errors.full_messages.join("\n") -
railties/lib/initializer.rb
old new 201 201 silence_warnings do 202 202 config = configuration 203 203 constants = self.class.constants 204 204 205 eval(IO.read(configuration.environment_path), binding, configuration.environment_path) 206 205 207 (self.class.constants - constants).each do |const| 206 208 Object.const_set(const, self.class.const_get(const)) 207 209 end