Skip to content
Browse files

private method doesn't work for singleton methods defined this way

  • Loading branch information...
1 parent 3af7b16 commit cb24aa16ebb0f9a31e05dbce4e608b56f05ba2f3 @dscataglini dscataglini committed
Showing with 12 additions and 6 deletions.
  1. +12 −6 activesupport/lib/active_support/callbacks.rb
View
18 activesupport/lib/active_support/callbacks.rb
@@ -131,8 +131,6 @@ def self.build(next_callback, user_callback, user_conditions, chain_config, filt
end
end
- private
-
def self.halting_and_conditional(next_callback, user_callback, user_conditions, halted_lambda, filter)
lambda { |env|
target = env.target
@@ -149,6 +147,7 @@ def self.halting_and_conditional(next_callback, user_callback, user_conditions,
next_callback.call env
}
end
+ private_class_method :halting_and_conditional
def self.halting(next_callback, user_callback, halted_lambda, filter)
lambda { |env|
@@ -166,6 +165,7 @@ def self.halting(next_callback, user_callback, halted_lambda, filter)
next_callback.call env
}
end
+ private_class_method :halting
def self.conditional(next_callback, user_callback, user_conditions)
lambda { |env|
@@ -178,6 +178,7 @@ def self.conditional(next_callback, user_callback, user_conditions)
next_callback.call env
}
end
+ private_class_method :conditional
def self.simple(next_callback, user_callback)
lambda { |env|
@@ -185,6 +186,7 @@ def self.simple(next_callback, user_callback)
next_callback.call env
}
end
+ private_class_method :simple
end
class After
@@ -208,8 +210,6 @@ def self.build(next_callback, user_callback, user_conditions, chain_config)
end
end
- private
-
def self.halting_and_conditional(next_callback, user_callback, user_conditions)
lambda { |env|
env = next_callback.call env
@@ -223,6 +223,7 @@ def self.halting_and_conditional(next_callback, user_callback, user_conditions)
env
}
end
+ private_class_method :halting_and_conditional
def self.halting(next_callback, user_callback)
lambda { |env|
@@ -233,6 +234,7 @@ def self.halting(next_callback, user_callback)
env
}
end
+ private_class_method :halting
def self.conditional(next_callback, user_callback, user_conditions)
lambda { |env|
@@ -246,6 +248,7 @@ def self.conditional(next_callback, user_callback, user_conditions)
env
}
end
+ private_class_method :conditional
def self.simple(next_callback, user_callback)
lambda { |env|
@@ -254,6 +257,7 @@ def self.simple(next_callback, user_callback)
env
}
end
+ private_class_method :simple
end
class Around
@@ -269,8 +273,6 @@ def self.build(next_callback, user_callback, user_conditions, chain_config)
end
end
- private
-
def self.halting_and_conditional(next_callback, user_callback, user_conditions)
lambda { |env|
target = env.target
@@ -288,6 +290,7 @@ def self.halting_and_conditional(next_callback, user_callback, user_conditions)
end
}
end
+ private_class_method :halting_and_conditional
def self.halting(next_callback, user_callback)
lambda { |env|
@@ -305,6 +308,7 @@ def self.halting(next_callback, user_callback)
end
}
end
+ private_class_method :halting
def self.conditional(next_callback, user_callback, user_conditions)
lambda { |env|
@@ -322,6 +326,7 @@ def self.conditional(next_callback, user_callback, user_conditions)
end
}
end
+ private_class_method :conditional
def self.simple(next_callback, user_callback)
lambda { |env|
@@ -332,6 +337,7 @@ def self.simple(next_callback, user_callback)
env
}
end
+ private_class_method :simple
end
end

0 comments on commit cb24aa1

Please sign in to comment.
Something went wrong with that request. Please try again.