def create(attributes={})
      attributes = attributes.symbolize_keys if attributes.respond_to?(:symbolize_keys)
      object = self.new(attributes)

      if object.present? && object.valid?
        if persistence_class == self
          object.id = nil unless exists?(object.id)

          object.save
        else
          object = PersistenceAdapter.create(self, object.attributes)
        end
      end

      new_object = serialize!(object.reload.attributes)

      new_object.valid?

      new_object
    end
def create(attributes={})
      attributes = attributes.symbolize_keys if attributes.respond_to?(:symbolize_keys)
      object = self.new(attributes)

      if object.present? && object.valid?
        if persistence_class == self
          object.id = nil unless exists?(object.id)

          object.save
        else
          object = PersistenceAdapter.create(self, object.attributes)
        end
      end

      new_object = serialize!(object.reload.attributes)

      new_object.valid?

      new_object
    end
Creates an object and persists it.