// CreateOrUpdate will create or update the activity
// (based on (provider,provider_id) key)
CreateOrUpdate will create or update the activity
(based on (provider,provider_id) key)
// CreateOrUpdate will create or update the activity // ( based on ( provider provider_id ) key )
func (a *Activity) CreateOrUpdate(tx *pop.Connection) error {
	tmpActivity := &Activity{}
	q := tx.Where("provider = ?", a.Provider).Where("provider_id = ?", a.ProviderID)
	q.First(tmpActivity)
	if IsSameActivity(a, tmpActivity) {
		return nil
	}
	a.ID = tmpActivity.ID
	err := tx.Save(a)
	return err
}
func ( a * Activity ) CreateOrUpdate ( tx * pop . Connection ) error { tmpActivity := & Activity { } q := tx . Where ( " " , a . Provider ) . Where ( " " , a . ProviderID ) q . First ( tmpActivity ) if IsSameActivity ( a , tmpActivity ) { return nil } a . ID = tmpActivity . ID err := tx . Save ( a ) return err }
CreateOrUpdate will create or update the activity
(based on (provider,provider_id) key)
CreateOrUpdate will create or update the activity ( based on ( provider provider_id ) key )