Check if ActiveRecord is defined before calling it in DisplayHelper