-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
I want to change the logic of mongoid's to_json by following code:
module Mongoid module Document def as_json(options={}) attrs = super(options) attrs["id"] = self.persisted? ? self._id : nil attrs end end end
where should I place it? So far I place it in application.rb and it can be loaded when starting rails. However, I want to move it to other place, where should I move to?