Update active_record.rb

caching and weird devise bug