Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

ActiveSupport::Inflector.camelize fails when you pass any object that's not a string

#2856

ActiveSupport::Inflector.camelize breaks if you execute this code:

  ActiveSupport::Inflector.camelize(:active_record, false)

Reported by calavera · June 30th, 2009 @ 04:10 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. calavera
    calavera
    • Tag changed from 2.x test patch, active_support, inflector to 2.x, active_support, inflector, patch, test

    June 30th, 2009 @ 04:10 PM

  2. calavera
    calavera

    Actually it breaks with every object that doesn't implement the method "first". This code also breaks:

    class MyClass; 
      def to_s
        "my class"
      end
    end
    
    ActiveSupport::Inflector.camelize(MyClass.new, false)
    

    June 30th, 2009 @ 04:39 PM

  3. calavera
    calavera
    • Title changed from Ensure ActiveSupport::Inflector.camelize works with symbols to ActiveSupport::Inflector.camelize fails when you pass any object that's not a string

    July 1st, 2009 @ 01:46 PM

  4. Repository