def export(options = nil)
      self.class.attributes.reduce({}) do |result, name|
        value = attributes[name]
        if self.class.association?(name, :many)
          result[name] = export_values(value, options)
        elsif self.class.association?(name, :one)
          result[name] = export_value(value, options)
        else
          result[name] = value
        end
        result
      end
    end
def export(options = nil)
      self.class.attributes.reduce({}) do |result, name|
        value = attributes[name]
        if self.class.association?(name, :many)
          result[name] = export_values(value, options)
        elsif self.class.association?(name, :one)
          result[name] = export_value(value, options)
        else
          result[name] = value
        end
        result
      end
    end
Two models are equal if their attributes are equal.
 Recursively convert all attributes to hash pairs.