Topic: Model associations not working in production mode [SOLVED]

Using Rails 3.1.0 and clearance 0.13.0 for authentication.


User belongs_to :userGroup
UserGroup has_many :users

I get the sign-in page correctly, but after login the association fails. I've locateted the problem here in the view:

in development mode this gives nicely the name attribute of the userGroup of the current_user

in production mode this line gives
ActionView::Template::Error (undefined method `name' for nil:NilClass)

so it seems the association is not working correctly.

edit: after going through everything possible I found out that database transfer had somehow gone wrong and there was a capitalization issue... doh!

Last edited by Bizhop (2011-11-14 07:27:35)