2

This is in my config/initializer/string.rb:

class String  
 include ClearCompany
end

I have lib/clear_company.rb

That is where I have a module ClearCompany.

Satchel
  • 16,414
  • 23
  • 106
  • 192

1 Answers1

2

You need to require that file, as constants aren't autoloaded from lib in Rails 3:

require 'clear_company'

You could also add lib back to the load paths by putting this in your Application's class:

config.autoload_paths += %W(#{Rails.root}/lib)  
Ryan Bigg
  • 106,965
  • 23
  • 235
  • 261
  • aw, I see....where should I put libs in the future if I don't put what you put in? – Satchel May 31 '11 at 16:28
  • @Angela: put them in `lib` still, you will just have to manually require them like you would in any other Ruby library too. Rails has just hanged their behaviour to be more standard. – Ryan Bigg Jun 01 '11 at 01:26
  • bigg I see, I used your auto_load paths as a solution so then I don't need to 'require' --- is that right? thanks! – Satchel Jun 01 '11 at 04:46