Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/gem-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Only test Ruby maintenance branches.
# https://www.ruby-lang.org/en/downloads/branches
name: Gem Tests
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests_matrix:
runs-on: ubuntu-latest
timeout-minutes: 3
strategy:
matrix:
ruby:
- "3.2"
- "3.3"
- "3.4"
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run Test Suite
run: ./test
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@

# Version 5.2.0
* Added the ability to manually trigger syncing of specific model attributes.

# Version 5.2.1
* Reverted accidental change to object creation during sync.
* Added CI for the test suite.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ gemspec

gem 'appraisal'
gem 'debug'
gem 'ostruct'
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ configuration variable _SALESFORCE_AR_SYNC_CONFIG["SYNC_ENABLED"]_

You can trigger a manual sync of any configured attributes. All checks to skip syncing or to sync asynchronously will still be executed.

If the record does not exist in Salesforce, the provided attributes will be ignored and all attributes will be synced.

```ruby
my_user_record.salesforce_sync(:email)

Expand Down
1 change: 1 addition & 0 deletions gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ source "https://rubygems.org"

gem "appraisal"
gem "debug"
gem "ostruct"
gem "rails", "~> 7.1.0"

gemspec path: "../"
1 change: 1 addition & 0 deletions gemfiles/rails_7.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ source "https://rubygems.org"

gem "appraisal"
gem "debug"
gem "ostruct"
gem "rails", "~> 7.2.0"

gemspec path: "../"
1 change: 1 addition & 0 deletions gemfiles/rails_8.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ source "https://rubygems.org"

gem "appraisal"
gem "debug"
gem "ostruct"
gem "rails", "~> 8.0.0"

gemspec path: "../"
4 changes: 2 additions & 2 deletions lib/salesforce_ar_sync/salesforce_sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ def salesforce_sync(*attrs)
else
if salesforce_object_exists?
salesforce_update_object(attributes_to_update) if attributes_to_update.present?
else
salesforce_create_object(attributes_to_update(!new_record?)) if salesforce_id.nil?
elsif salesforce_id.nil?
salesforce_create_object(salesforce_attributes_to_update(!new_record?))
end
end
rescue Exception => ex
Expand Down
2 changes: 1 addition & 1 deletion lib/salesforce_ar_sync/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module SalesforceArSync
VERSION = '5.2.0'
VERSION = '5.2.1'
end
2 changes: 1 addition & 1 deletion spec/salesforce_ar_sync/salesforce_ar_sync_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'spec_helper.rb'
require 'spec_helper'

# for testing our environment variables
SalesforceArSync.config = {}
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'bundler/setup'
require 'debug'
require 'ostruct'
require 'rails/all'
require 'salesforce_ar_sync'
require 'active_record'
Expand Down