aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionview/lib/action_view/helpers/tag_helper.rb13
-rw-r--r--activerecord/lib/active_record/associations/has_many_association.rb12
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb14
-rw-r--r--activesupport/test/testing/file_fixtures_test.rb2
4 files changed, 23 insertions, 18 deletions
diff --git a/actionview/lib/action_view/helpers/tag_helper.rb b/actionview/lib/action_view/helpers/tag_helper.rb
index 0633cfc2b4..4ba37fd5e5 100644
--- a/actionview/lib/action_view/helpers/tag_helper.rb
+++ b/actionview/lib/action_view/helpers/tag_helper.rb
@@ -115,6 +115,7 @@ module ActionView
# Returns an HTML tag.
#
# === Building HTML tags
+ #
# Builds HTML5 compliant tags with a tag proxy. Every tag can be built with:
#
# tag.<tag name>(optional content, options)
@@ -122,6 +123,7 @@ module ActionView
# where tag name can be e.g. br, div, section, article, or any tag really.
#
# ==== Passing content
+ #
# Tags can pass content to embed within it:
#
# tag.h1 'All titles fit to print' # => <h1>All titles fit to print</h1>
@@ -136,6 +138,7 @@ module ActionView
# # => <p>The next great American novel starts here.</p>
#
# ==== Options
+ #
# Any passed options become attributes on the generated tag.
#
# tag.section class: %w( kitties puppies )
@@ -177,7 +180,7 @@ module ActionView
# # => <img src="open & shut.png">
#
# The tag builder respects
- # [HTML5 void elements](https://www.w3.org/TR/html5/syntax.html#void-elements)
+ # {HTML5 void elements}[https://www.w3.org/TR/html5/syntax.html#void-elements]
# if no content is passed, and omits closing tags for those elements.
#
# # A standard element:
@@ -187,18 +190,19 @@ module ActionView
# tag.br # => <br>
#
# === Legacy syntax
+ #
# The following format is for legacy syntax support. It will be deprecated in future versions of Rails.
#
- # tag(tag_name, options)
+ # tag(name, options = nil, open = false, escape = true)
#
- # === Building HTML tags
- # Returns an empty HTML tag of type +name+ which by default is XHTML
+ # It returns an empty HTML tag of type +name+ which by default is XHTML
# compliant. Set +open+ to true to create an open tag compatible
# with HTML 4.0 and below. Add HTML attributes by passing an attributes
# hash to +options+. Set +escape+ to false to disable attribute value
# escaping.
#
# ==== Options
+ #
# You can use symbols or strings for the attribute names.
#
# Use +true+ with boolean attributes that can render with no value, like
@@ -208,6 +212,7 @@ module ActionView
# pointing to a hash of sub-attributes.
#
# ==== Examples
+ #
# tag("br")
# # => <br />
#
diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb
index a9f6aaafef..4daafedcfb 100644
--- a/activerecord/lib/active_record/associations/has_many_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_association.rb
@@ -27,14 +27,12 @@ module ActiveRecord
throw(:abort)
end
+ when :destroy
+ # No point in executing the counter update since we're going to destroy the parent anyway
+ load_target.each { |t| t.destroyed_by_association = reflection }
+ destroy_all
else
- if options[:dependent] == :destroy
- # No point in executing the counter update since we're going to destroy the parent anyway
- load_target.each { |t| t.destroyed_by_association = reflection }
- destroy_all
- else
- delete_all
- end
+ delete_all
end
end
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb
index 78bfcf34a9..eadd73aab0 100644
--- a/activerecord/lib/active_record/attribute_methods.rb
+++ b/activerecord/lib/active_record/attribute_methods.rb
@@ -209,13 +209,13 @@ module ActiveRecord
# end
#
# person = Person.new
- # person.respond_to(:name) # => true
- # person.respond_to(:name=) # => true
- # person.respond_to(:name?) # => true
- # person.respond_to('age') # => true
- # person.respond_to('age=') # => true
- # person.respond_to('age?') # => true
- # person.respond_to(:nothing) # => false
+ # person.respond_to?(:name) # => true
+ # person.respond_to?(:name=) # => true
+ # person.respond_to?(:name?) # => true
+ # person.respond_to?('age') # => true
+ # person.respond_to?('age=') # => true
+ # person.respond_to?('age?') # => true
+ # person.respond_to?(:nothing) # => false
def respond_to?(name, include_private = false)
return false unless super
diff --git a/activesupport/test/testing/file_fixtures_test.rb b/activesupport/test/testing/file_fixtures_test.rb
index 3587c1a4d1..d98987fb8d 100644
--- a/activesupport/test/testing/file_fixtures_test.rb
+++ b/activesupport/test/testing/file_fixtures_test.rb
@@ -1,5 +1,7 @@
require 'abstract_unit'
+require 'pathname'
+
class FileFixturesTest < ActiveSupport::TestCase
self.file_fixture_path = File.expand_path("../../file_fixtures", __FILE__)