diff options
author | Rafael Mendonça França <rafael@franca.dev> | 2019-08-01 11:18:42 -0400 |
---|---|---|
committer | Rafael Mendonça França <rafael@franca.dev> | 2019-08-01 11:18:42 -0400 |
commit | d40c88ae05ba2441c6bec3e87a8939a43ed7c84e (patch) | |
tree | 1e7aaa71266d86cbd38d7f88065a2db885640916 /actionview | |
parent | 11cb8c48ee4ebe6ed14ea78d6c416ad4857c4ffe (diff) | |
download | rails-d40c88ae05ba2441c6bec3e87a8939a43ed7c84e.tar.gz rails-d40c88ae05ba2441c6bec3e87a8939a43ed7c84e.tar.bz2 rails-d40c88ae05ba2441c6bec3e87a8939a43ed7c84e.zip |
No private def
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/lib/action_view/helpers/url_helper.rb | 6 | ||||
-rw-r--r-- | actionview/lib/action_view/layouts.rb | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/actionview/lib/action_view/helpers/url_helper.rb b/actionview/lib/action_view/helpers/url_helper.rb index cebb2aea4d..61ab3c2e13 100644 --- a/actionview/lib/action_view/helpers/url_helper.rb +++ b/actionview/lib/action_view/helpers/url_helper.rb @@ -42,11 +42,12 @@ module ActionView end end - private def _back_url # :nodoc: + def _back_url # :nodoc: _filtered_referrer || "javascript:history.back()" end + private :_back_url - private def _filtered_referrer # :nodoc: + def _filtered_referrer # :nodoc: if controller.respond_to?(:request) referrer = controller.request.env["HTTP_REFERER"] if referrer && URI(referrer).scheme != "javascript" @@ -55,6 +56,7 @@ module ActionView end rescue URI::InvalidURIError end + private :_filtered_referrer # Creates an anchor element of the given +name+ using a URL created by the set of +options+. # See the valid options in the documentation for +url_for+. It's also possible to diff --git a/actionview/lib/action_view/layouts.rb b/actionview/lib/action_view/layouts.rb index db92f905d4..3fdd9fb272 100644 --- a/actionview/lib/action_view/layouts.rb +++ b/actionview/lib/action_view/layouts.rb @@ -305,12 +305,13 @@ module ActionView end RUBY when Proc - private define_method :_layout_from_proc, &_layout + define_method :_layout_from_proc, &_layout <<-RUBY result = _layout_from_proc(#{_layout.arity == 0 ? '' : 'self'}) return #{default_behavior} if result.nil? result RUBY + private :_layout_from_proc when false nil when true |