mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
No private def
This commit is contained in:
parent
11cb8c48ee
commit
d40c88ae05
3 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -221,7 +221,7 @@ module ActiveRecord
|
|||
end
|
||||
|
||||
class_methods do
|
||||
private def define_column_methods(*column_types) # :nodoc:
|
||||
def define_column_methods(*column_types) # :nodoc:
|
||||
column_types.each do |column_type|
|
||||
module_eval <<-RUBY, __FILE__, __LINE__ + 1
|
||||
def #{column_type}(*names, **options)
|
||||
|
@ -231,6 +231,7 @@ module ActiveRecord
|
|||
RUBY
|
||||
end
|
||||
end
|
||||
private :define_column_methods
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue