mirror of https://github.com/rails/rails
Reduce number of Strings a bit
This commit is contained in:
parent
c8e632bd9f
commit
3c21237c37
|
@ -320,7 +320,7 @@ module ActionController #:nodoc:
|
|||
# 2. <tt>:action</tt> - overwrites the default render action used after an
|
||||
# unsuccessful html +post+ request.
|
||||
def respond_with(*resources, &block)
|
||||
raise "In order to use respond_with, first you need to declare the formats your " <<
|
||||
raise "In order to use respond_with, first you need to declare the formats your " \
|
||||
"controller responds to in the class level" if self.class.mimes_for_respond_to.empty?
|
||||
|
||||
if collector = retrieve_collector_from_mimes(&block)
|
||||
|
|
|
@ -16,9 +16,9 @@ module ActionDispatch
|
|||
# catches the exceptions and returns a FAILSAFE_RESPONSE.
|
||||
class ShowExceptions
|
||||
FAILSAFE_RESPONSE = [500, { 'Content-Type' => 'text/plain' },
|
||||
["500 Internal Server Error\n" <<
|
||||
"If you are the administrator of this website, then please read this web " <<
|
||||
"application's log file and/or the web server's log file to find out what " <<
|
||||
["500 Internal Server Error\n" \
|
||||
"If you are the administrator of this website, then please read this web " \
|
||||
"application's log file and/or the web server's log file to find out what " \
|
||||
"went wrong."]]
|
||||
|
||||
def initialize(app, exceptions_app)
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'active_support/core_ext/range'
|
|||
module ActiveModel
|
||||
module Validations
|
||||
module Clusivity #:nodoc:
|
||||
ERROR_MESSAGE = "An object with the method #include? or a proc, lambda or symbol is required, " <<
|
||||
ERROR_MESSAGE = "An object with the method #include? or a proc, lambda or symbol is required, " \
|
||||
"and must be supplied as the :in (or :within) option of the configuration hash"
|
||||
|
||||
def check_validity!
|
||||
|
|
|
@ -17,9 +17,9 @@ module ActiveModel
|
|||
end
|
||||
|
||||
def validate_each(record, attr_name, value)
|
||||
before_type_cast = "#{attr_name}_before_type_cast"
|
||||
before_type_cast = :"#{attr_name}_before_type_cast"
|
||||
|
||||
raw_value = record.send(before_type_cast) if record.respond_to?(before_type_cast.to_sym)
|
||||
raw_value = record.send(before_type_cast) if record.respond_to?(before_type_cast)
|
||||
raw_value ||= value
|
||||
|
||||
return if options[:allow_nil] && raw_value.nil?
|
||||
|
|
Loading…
Reference in New Issue