aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/concern.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-11-29 14:53:19 -0500
committerGitHub <noreply@github.com>2018-11-29 14:53:19 -0500
commitc8e4d5a1e3be2290bc6007987e40312e19480474 (patch)
treeb9cb04098bb4af58e3b4c2d97bb2872d3a1e2235 /activesupport/lib/active_support/concern.rb
parent5bb4546439ed20a864c6df18788dce0eb45d8326 (diff)
parent8212dfcf14c63c006b9e1c37595f3d62eab052cf (diff)
downloadrails-c8e4d5a1e3be2290bc6007987e40312e19480474.tar.gz
rails-c8e4d5a1e3be2290bc6007987e40312e19480474.tar.bz2
rails-c8e4d5a1e3be2290bc6007987e40312e19480474.zip
Merge pull request #34553 from mjtko/fix/issue-14802
Do nothing when the same block is included again
Diffstat (limited to 'activesupport/lib/active_support/concern.rb')
-rw-r--r--activesupport/lib/active_support/concern.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/concern.rb b/activesupport/lib/active_support/concern.rb
index b0a0d845e5..5d356a0ab6 100644
--- a/activesupport/lib/active_support/concern.rb
+++ b/activesupport/lib/active_support/concern.rb
@@ -125,9 +125,13 @@ module ActiveSupport
def included(base = nil, &block)
if base.nil?
- raise MultipleIncludedBlocks if instance_variable_defined?(:@_included_block)
-
- @_included_block = block
+ if instance_variable_defined?(:@_included_block)
+ if @_included_block.source_location != block.source_location
+ raise MultipleIncludedBlocks
+ end
+ else
+ @_included_block = block
+ end
else
super
end