Sha256: b4f21b77394bbace0f777c2f15c1cc81da66e7f131abb413560fec1f36cc160a

Contents?: true

Size: 491 Bytes

Versions: 5

Compression:

Stored size: 491 Bytes

Contents

module CiviCrm
  module Actions
    module Update
      def update(attrs = {})
        params = {
          'entity' => self.class.entity_class_name,
          'action' => 'create',
          'id' => id
        }.merge(attributes).merge(attrs)

        response = CiviCrm::Client.request(:post, params)
        refresh_from(response.first.to_hash)
      end

      def save
        @previously_changed = changes
        @changed_attributes.clear
        update()
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
civicrm-1.0.7 lib/civicrm/actions/update.rb
civicrm-1.0.6 lib/civicrm/actions/update.rb
civicrm-1.0.5 lib/civicrm/actions/update.rb
civicrm-1.0.4 lib/civicrm/actions/update.rb
civicrm-1.0.2 lib/civicrm/actions/update.rb