def to_hash(args = {}) # :nodoc:
      args ||= {}

      if args[:nested]
        {'url' => self[:@url] || self[:url]}
      else
        hash = super
        hash.merge!('@version' => self['@version']) unless new_record?
        {self.class.json_name => hash}
      end
    end
def to_hash(args = {}) # :nodoc:
      args ||= {}

      if args[:nested]
        {'url' => self[:@url] || self[:url]}
      else
        hash = super
        hash.merge!('@version' => self['@version']) unless new_record?
        {self.class.json_name => hash}
      end
    end
ActiveSupport caused problems when using as_json, so using to_hash