method_missing only in production using custom validation

My hunch would be because of environment.rb and requiring dependencies - Space Vatican

Fred

You were right.

When i turned of config.cache_classes in my environments/production.rb everything worked great. Of course I cant run a deployment like that, sooo...i moved my " require 'custom_validations' " into my model right above my validation call, to ensure it gets loaded in the right order. I'm not sure how kosher this is, but it fixed the problem.

models/phrase.rb: ... require 'custom_validations validates_not_spam :word ...

You were right.

When i turned of config.cache_classes in my environments/production.rb everything worked great. Of course I cant run a deployment like that, sooo...i moved my " require 'custom_validations' " into my model right above my validation call, to ensure it gets loaded in the right order. I'm not sure how kosher this is, but it fixed the problem.

Personally my preferred solution is what is outline in the blog post:
have an initializer that requires stuff like that'

Guess i'm just dense, that worked great too. I had never used initalizers/ before except to regulate inflections, just created an Application.rb and threw in my

require 'custom_validations'

Thanks Fred!!