Rails.env == 'production' という式は、 Rails.env.production? と書ける。これは Rails.env が単なる文字列ではなく、ActiveSupport::StringInquirer という String を継承したクラスに変換されているから。 https://github.com/rails/rails/blob/master/activesupport/lib/active_support/string_inquirer.rb ActiveSupport.StringInquirer.new("foo").foo? #=> true ちなみに、Rails 3.1 では、String#inquiry で String から StringInquirer を生成できる。 Rails.version # => "3.1.0.beta1" s =