Skip to content
This repository
Browse code

Reduce number of Strings a bit

  • Loading branch information...
commit 3c21237c37fed9d726bcf2816bf1adc4635f4956 1 parent c8e632b
Akira Matsuda amatsuda authored
2  actionpack/lib/action_controller/metal/mime_responds.rb
@@ -320,7 +320,7 @@ def respond_to(*mimes, &block)
320 320 # 2. <tt>:action</tt> - overwrites the default render action used after an
321 321 # unsuccessful html +post+ request.
322 322 def respond_with(*resources, &block)
323   - raise "In order to use respond_with, first you need to declare the formats your " <<
  323 + raise "In order to use respond_with, first you need to declare the formats your " \
324 324 "controller responds to in the class level" if self.class.mimes_for_respond_to.empty?
325 325
326 326 if collector = retrieve_collector_from_mimes(&block)
6 actionpack/lib/action_dispatch/middleware/show_exceptions.rb
@@ -16,9 +16,9 @@ module ActionDispatch
16 16 # catches the exceptions and returns a FAILSAFE_RESPONSE.
17 17 class ShowExceptions
18 18 FAILSAFE_RESPONSE = [500, { 'Content-Type' => 'text/plain' },
19   - ["500 Internal Server Error\n" <<
20   - "If you are the administrator of this website, then please read this web " <<
21   - "application's log file and/or the web server's log file to find out what " <<
  19 + ["500 Internal Server Error\n" \
  20 + "If you are the administrator of this website, then please read this web " \
  21 + "application's log file and/or the web server's log file to find out what " \
22 22 "went wrong."]]
23 23
24 24 def initialize(app, exceptions_app)
2  activemodel/lib/active_model/validations/clusivity.rb
@@ -3,7 +3,7 @@
3 3 module ActiveModel
4 4 module Validations
5 5 module Clusivity #:nodoc:
6   - ERROR_MESSAGE = "An object with the method #include? or a proc, lambda or symbol is required, " <<
  6 + ERROR_MESSAGE = "An object with the method #include? or a proc, lambda or symbol is required, " \
7 7 "and must be supplied as the :in (or :within) option of the configuration hash"
8 8
9 9 def check_validity!
4 activemodel/lib/active_model/validations/numericality.rb
@@ -17,9 +17,9 @@ def check_validity!
17 17 end
18 18
19 19 def validate_each(record, attr_name, value)
20   - before_type_cast = "#{attr_name}_before_type_cast"
  20 + before_type_cast = :"#{attr_name}_before_type_cast"
21 21
22   - raw_value = record.send(before_type_cast) if record.respond_to?(before_type_cast.to_sym)
  22 + raw_value = record.send(before_type_cast) if record.respond_to?(before_type_cast)
23 23 raw_value ||= value
24 24
25 25 return if options[:allow_nil] && raw_value.nil?

0 comments on commit 3c21237

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