Reverted the toJSON method, ActiveRecord support is determined in runtime