Changeset 8301
- Timestamp:
- 12/05/07 18:54:41 (1 year ago)
- Files:
-
- trunk/actionmailer/Rakefile (modified) (1 diff)
- trunk/actionpack/lib/action_controller/assertions.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/base.rb (modified) (4 diffs)
- trunk/actionpack/lib/action_controller/layout.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/rescue.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/routing_optimisation.rb (modified) (1 diff)
- trunk/actionpack/lib/action_view/helpers/asset_tag_helper.rb (modified) (1 diff)
- trunk/actionpack/lib/action_view/helpers/date_helper.rb (modified) (4 diffs)
- trunk/actionpack/lib/action_view/helpers/number_helper.rb (modified) (1 diff)
- trunk/actionpack/lib/action_view/helpers/url_helper.rb (modified) (1 diff)
- trunk/actionpack/test/controller/routing_test.rb (modified) (2 diffs)
- trunk/actionpack/test/controller/selector_test.rb (modified) (1 diff)
- trunk/actionpack/test/controller/test_test.rb (modified) (1 diff)
- trunk/activerecord/lib/active_record/aggregations.rb (modified) (1 diff)
- trunk/activerecord/lib/active_record/associations.rb (modified) (1 diff)
- trunk/activerecord/lib/active_record/associations/has_many_through_association.rb (modified) (1 diff)
- trunk/activerecord/lib/active_record/attribute_methods.rb (modified) (1 diff)
- trunk/activerecord/lib/active_record/callbacks.rb (modified) (1 diff)
- trunk/activerecord/test/validations_test.rb (modified) (1 diff)
- trunk/activesupport/lib/active_support/core_ext/array/conversions.rb (modified) (1 diff)
- trunk/activesupport/test/multibyte_handler_test.rb (modified) (1 diff)
- trunk/railties/lib/initializer.rb (modified) (2 diffs)
- trunk/railties/lib/rails/plugin/loader.rb (modified) (1 diff)
- trunk/railties/test/generators/generator_test_helper.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionmailer/Rakefile
r8233 r8301 30 30 31 31 32 # Gener eate the RDoc documentation32 # Generate the RDoc documentation 33 33 Rake::RDocTask.new { |rdoc| 34 34 rdoc.rdoc_dir = 'doc' trunk/actionpack/lib/action_controller/assertions.rb
r7719 r8301 17 17 # 18 18 # For historic reasons, the assigns hash uses string-based keys. So assigns[:person] won't work, but assigns["person"] will. To 19 # appease our yearning for symbols, though, an alternative accessor has been devi ced using a method call instead of index referencing.19 # appease our yearning for symbols, though, an alternative accessor has been devised using a method call instead of index referencing. 20 20 # So assigns(:person) will work just like assigns["person"], but again, assigns[:person] will not work. 21 21 # trunk/actionpack/lib/action_controller/base.rb
r8235 r8301 165 165 # remove the entire session with reset_session. 166 166 # 167 # Sessions are stored in a browser cookie that's cry tographically signed, but unencrypted, by default. This prevents167 # Sessions are stored in a browser cookie that's cryptographically signed, but unencrypted, by default. This prevents 168 168 # the user from tampering with the session but also allows him to see its contents. 169 169 # … … 294 294 # <tt>params</tt> hash. These handlers are invoked for post and put requests. 295 295 # 296 # By default application/xml is enabled. A XmlSimple class with the same param name as the root will be instan ciated296 # By default application/xml is enabled. A XmlSimple class with the same param name as the root will be instantiated 297 297 # in the <tt>params</tt>. This allows XML requests to mask themselves as regular form submissions, so you can have one 298 298 # action serve both regular forms and web service requests. … … 455 455 end 456 456 457 # Replace sensitive param ater data from the request log.458 # Filters param aters that have any of the arguments as a substring.457 # Replace sensitive parameter data from the request log. 458 # Filters parameters that have any of the arguments as a substring. 459 459 # Looks in all subhashes of the param hash for keys to filter. 460 # If a block is given, each key and value of the param ater hash and all460 # If a block is given, each key and value of the parameter hash and all 461 461 # subhashes is passed to it, the value or key 462 462 # can be replaced using String#replace or similar method. … … 591 591 # answer has to do with the order in which the parameters appear in the generated path. In a nutshell, since the 592 592 # value that appears in the slot for <tt>:first</tt> is not equal to default value for <tt>:first</tt> we stop using 593 # defaults. On it 's own, this rule can account for much of the typical Rails URL behavior.593 # defaults. On its own, this rule can account for much of the typical Rails URL behavior. 594 594 # Â 595 595 # Although a convenience, defaults can occasionally get in your way. In some cases a default persists longer than desired. trunk/actionpack/lib/action_controller/layout.rb
r7719 r8301 71 71 # assignment. So an Admin::WeblogController will look for a template named <tt>app/views/layouts/admin/weblog.erb</tt>. 72 72 # Setting a layout explicitly will always override the automatic behaviour for the controller where the layout is set. 73 # Explicitly setting the layout in a parent class, though, will not override the child class's layout assign ement if the child73 # Explicitly setting the layout in a parent class, though, will not override the child class's layout assignment if the child 74 74 # class has a layout with the same name. 75 75 # trunk/actionpack/lib/action_controller/rescue.rb
r8165 r8301 228 228 # could trigger some other handler and the array could include 229 229 # precisely a string whose corresponding constant has not yet been 230 # seen. This is why we are tolerant to unk own constants.230 # seen. This is why we are tolerant to unknown constants. 231 231 # 232 232 # Note that this tolerance only matters if the exception was given as trunk/actionpack/lib/action_controller/routing_optimisation.rb
r8228 r8301 9 9 # 10 10 # To support building optimisations for other common cases, the 11 # generation code is sep erated into several classes11 # generation code is separated into several classes 12 12 module Optimisation 13 13 def generate_optimisation_block(route, kind) trunk/actionpack/lib/action_view/helpers/asset_tag_helper.rb
r8220 r8301 357 357 # ==== Options 358 358 # You can add HTML attributes using the +options+. The +options+ supports 359 # three additional keys for conv ienence and conformance:359 # three additional keys for convenience and conformance: 360 360 # 361 361 # * <tt>:alt</tt> - If no alt text is given, the file name part of the trunk/actionpack/lib/action_view/helpers/date_helper.rb
r8101 r8301 214 214 # It's also possible to explicitly set the order of the tags using the <tt>:order</tt> option with an array of 215 215 # symbols <tt>:year</tt>, <tt>:month</tt> and <tt>:day</tt> in the desired order. If you do not supply a Symbol, it 216 # will be appen ed onto the <tt>:order</tt> passed in. You can also add <tt>:date_separator</tt> and <tt>:time_separator</tt>216 # will be appended onto the <tt>:order</tt> passed in. You can also add <tt>:date_separator</tt> and <tt>:time_separator</tt> 217 217 # keys to the +options+ to control visual display of the elements. 218 218 # … … 227 227 # 228 228 # # Generates a datetime select that defaults to the datetime in my_date_time (four days after today) 229 # # with the fields ordered year, month, day rather th en month, day, year.229 # # with the fields ordered year, month, day rather than month, day, year. 230 230 # select_datetime(my_date_time, :order => [:year, :month, :day]) 231 231 # … … 250 250 # It's possible to explicitly set the order of the tags using the <tt>:order</tt> option with an array of 251 251 # symbols <tt>:year</tt>, <tt>:month</tt> and <tt>:day</tt> in the desired order. If you do not supply a Symbol, it 252 # will be appen ed onto the <tt>:order</tt> passed in.252 # will be appended onto the <tt>:order</tt> passed in. 253 253 # 254 254 # ==== Examples … … 262 262 # 263 263 # # Generates a date select that defaults to the date in my_date (six days after today) 264 # # with the fields ordered year, month, day rather th en month, day, year.264 # # with the fields ordered year, month, day rather than month, day, year. 265 265 # select_date(my_date, :order => [:year, :month, :day]) 266 266 # trunk/actionpack/lib/action_view/helpers/number_helper.rb
r7719 r8301 22 22 # number_to_phone(1235551234, :country_code => 1) # => +1-123-555-1234 23 23 # 24 # number_to_phone(1235551234, :country_code => 1, :extension => 1343, :delim eter => ".")24 # number_to_phone(1235551234, :country_code => 1, :extension => 1343, :delimiter => ".") 25 25 # => +1.123.555.1234 x 1343 26 26 def number_to_phone(number, options = {}) trunk/actionpack/lib/action_view/helpers/url_helper.rb
r8091 r8301 332 332 # HTML attributes for the link can be passed in +html_options+. 333 333 # 334 # mail_to has several methods for hindering email harvest ors and customizing334 # mail_to has several methods for hindering email harvesters and customizing 335 335 # the email itself by passing special keys to +html_options+. 336 336 # trunk/actionpack/test/controller/routing_test.rb
r8227 r8301 883 883 884 884 def test_build_pattern_non_optional_with_no_captures 885 # Non optio anl885 # Non optional 886 886 a_segment = ROUTING::DynamicSegment.new 887 887 a_segment.regexp = /\d+/ #number_of_captures is 0 … … 890 890 891 891 def test_build_pattern_non_optional_with_captures 892 # Non optio anl892 # Non optional 893 893 a_segment = ROUTING::DynamicSegment.new 894 894 a_segment.regexp = /(\d+)(.*?)/ #number_of_captures is 2 trunk/actionpack/test/controller/selector_test.rb
r7666 r8301 86 86 assert_equal "2", @matches[0].attributes["id"] 87 87 assert_equal "3", @matches[1].attributes["id"] 88 # Match alement with attribute value.88 # Match element with attribute value. 89 89 select("*[title=foo]") 90 90 assert_equal 1, @matches.size 91 91 assert_equal "3", @matches[0].attributes["id"] 92 # Match alement with attribute and attribute value.92 # Match element with attribute and attribute value. 93 93 select("[bar=foo][title]") 94 94 assert_equal 1, @matches.size trunk/actionpack/test/controller/test_test.rb
r8022 r8301 215 215 process :test_html_output 216 216 217 # there is a tag with a de cendant 'li' tag217 # there is a tag with a descendant 'li' tag 218 218 assert_tag :descendant => { :tag => "li" } 219 219 # there is no tag with a descendant 'html' tag trunk/activerecord/lib/active_record/aggregations.rb
r8003 r8301 124 124 # 125 125 # An optional block can be passed to convert the argument that is passed to the writer method into an instance of 126 # <tt>:class_name</tt>. The block will only be called if the argu ement is not already an instance of <tt>:class_name</tt>.126 # <tt>:class_name</tt>. The block will only be called if the argument is not already an instance of <tt>:class_name</tt>. 127 127 # 128 128 # Option examples: trunk/activerecord/lib/active_record/associations.rb
r8270 r8301 267 267 # === Association callbacks 268 268 # 269 # Simil iar to the normal callbacks that hook into the lifecycle of an Active Record object, you can also define callbacks that get269 # Similar to the normal callbacks that hook into the lifecycle of an Active Record object, you can also define callbacks that get 270 270 # triggered when you add an object to or remove an object from an association collection. Example: 271 271 # trunk/activerecord/lib/active_record/associations/has_many_through_association.rb
r8178 r8301 121 121 column_name, options = @reflection.klass.send(:construct_count_options_from_args, *args) 122 122 if @reflection.options[:uniq] 123 # This is needed beca se 'SELECT count(DISTINCT *)..' is not valid sql statement.123 # This is needed because 'SELECT count(DISTINCT *)..' is not valid sql statement. 124 124 column_name = "#{@reflection.klass.table_name}.#{@reflection.klass.primary_key}" if column_name == :all 125 125 options.merge!(:distinct => true) trunk/activerecord/lib/active_record/attribute_methods.rb
r7827 r8301 80 80 end 81 81 82 # Check to see if the method is defined in the model or any of it 's subclasses that also derive from ActiveRecord.82 # Check to see if the method is defined in the model or any of its subclasses that also derive from ActiveRecord. 83 83 # Raise DangerousAttributeError if the method is defined by ActiveRecord though. 84 84 def instance_method_already_implemented?(method_name) trunk/activerecord/lib/active_record/callbacks.rb
r8131 r8301 165 165 # Nothing will be appended to the errors object. 166 166 # 167 # == Cancel ling callbacks167 # == Canceling callbacks 168 168 # 169 169 # If a <tt>before_*</tt> callback returns +false+, all the later callbacks and the associated action are cancelled. If an <tt>after_*</tt> callback returns trunk/activerecord/test/validations_test.rb
r8208 r8301 368 368 369 369 # Should succeed as validates_uniqueness_of only applies to 370 # UniqueReply and it 's subclasses370 # UniqueReply and its subclasses 371 371 r3 = t.replies.create "title" => "r2", "content" => "a barrel of fun" 372 372 assert r3.valid?, "Saving r3" trunk/activesupport/lib/active_support/core_ext/array/conversions.rb
r8251 r8301 5 5 module Array #:nodoc: 6 6 module Conversions 7 # Converts the array to comma-seperated sentence where the last element is joined by the connector word. Options:7 # Converts the array to a comma-separated sentence where the last element is joined by the connector word. Options: 8 8 # * <tt>:connector</tt> - The word used to join the last element in arrays with two or more elements (default: "and") 9 9 # * <tt>:skip_last_comma</tt> - Set to true to return "a, b and c" instead of "a, b, and c". trunk/activesupport/test/multibyte_handler_test.rb
r7910 r8301 70 70 end 71 71 72 # Test for the Public Review Issue #29, bad expla ination of composition might lead to a72 # Test for the Public Review Issue #29, bad explanation of composition might lead to a 73 73 # bad implementation: http://www.unicode.org/review/pr-29.html 74 74 def test_normalization_C_pri_29 trunk/railties/lib/initializer.rb
r8115 r8301 177 177 # In the default implementation, as each plugin discovered in <tt>plugin_paths</tt> is initialized: 178 178 # * its +lib+ directory, if present, is added to the load path (immediately after the applications lib directory) 179 # * <tt>init.rb</tt> is evalu tated, if present179 # * <tt>init.rb</tt> is evaluated, if present 180 180 # 181 181 # After all plugins are loaded, duplicates are removed from the load path. … … 218 218 end 219 219 220 # This initial zation sets $KCODE to 'u' to enable the multibyte safe operations.220 # This initialization sets $KCODE to 'u' to enable the multibyte safe operations. 221 221 # Plugin authors supporting other encodings should override this behaviour and 222 222 # set the relevant +default_charset+ on ActionController::Base trunk/railties/lib/rails/plugin/loader.rb
r8115 r8301 11 11 # are then fully loaded (init.rb is evaluated) when load_plugins is called. 12 12 # 13 # It is the loader's responsibil ty to ensure that only the plugins specified13 # It is the loader's responsibility to ensure that only the plugins specified 14 14 # in the configuration are actually loaded, and that the order defined 15 15 # is respected. trunk/railties/test/generators/generator_test_helper.rb
r7108 r8301 1 1 module GeneratorTestHelper 2 # Insta tiates the Generator2 # Instantiates the Generator 3 3 def build_generator(name,params) 4 4 Rails::Generator::Base.instance(name,params)