diff options
3 files changed, 29 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb b/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb index 01863a162b..63b4ba49e9 100644 --- a/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +++ b/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb @@ -3,12 +3,23 @@ class Hash # # options = options.reverse_merge(:size => 25, :velocity => 10) # +<<<<<<< HEAD + # The default <tt>:size</tt> and <tt>:velocity</tt> are only set if the +options+ hash passed in doesn't already + # have the respective key. + # + # As contrast, using Ruby's built in <tt>merge</tt> would require writing the following: + # + # def setup(options = {}) + # options = { :size => 25, :velocity => 10 }.merge(options) + # end +======= # is equivalent to # # options = {:size => 25, :velocity => 10}.merge(options) # # This is particularly useful for initializing an options hash # with default values. +>>>>>>> 20768176292cbcb883ab152b4aa9ed8c664771cd def reverse_merge(other_hash) other_hash.merge(self) end diff --git a/activesupport/lib/active_support/core_ext/object/blank.rb b/activesupport/lib/active_support/core_ext/object/blank.rb index d0c1ea8326..7b5832b51a 100644 --- a/activesupport/lib/active_support/core_ext/object/blank.rb +++ b/activesupport/lib/active_support/core_ext/object/blank.rb @@ -13,7 +13,11 @@ class Object respond_to?(:empty?) ? empty? : !self end +<<<<<<< HEAD + # An object is present if it's not #blank?. +======= # An object is present if it's not <tt>blank?</tt>. +>>>>>>> 20768176292cbcb883ab152b4aa9ed8c664771cd def present? !blank? end diff --git a/railties/guides/source/contributing_to_ruby_on_rails.textile b/railties/guides/source/contributing_to_ruby_on_rails.textile index 3454b8b7a3..82e7edfc84 100644 --- a/railties/guides/source/contributing_to_ruby_on_rails.textile +++ b/railties/guides/source/contributing_to_ruby_on_rails.textile @@ -364,6 +364,20 @@ Please make sure the patch does not introduce whitespace errors: $ git apply --whitespace=error-all mynew_patch.diff </shell> +You can check your patches by applying your patch to an different dedicated branch: + +<shell> +$ git checkout -b testing_branch +$ git apply --check my_new_patch.diff +</shell> + +You can make sure your patches don't add any whitespace by applying it yourself using the --whitespace=error-all option. Make sure you are on your dedicated test branche and: + +<shell> +$ git apply --whitespace=error-all mynew_patch.diff +</shell> + + h4. Create a Lighthouse Ticket Now create a ticket with your patch. Go to the "new ticket":http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/new page at Lighthouse. Fill in a reasonable title and description, remember to attach your patch file, and tag the ticket with the ‘patch’ tag and whatever other subject area tags make sense. |