Fixed ActiveRecord integration