openstax_active_force 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c62816549592114aa2162d2a9de73c80fe873d947fefe47da1d41e2dfcd4a8ea
4
- data.tar.gz: 4054c4a6ec4d7a29635ec83c7b1b52e360d6ad107e6a1852227bf560002f789d
3
+ metadata.gz: 54fa156c008353ebf36138acd1e419508f66ce233cdb896abd9dad6ab188b18c
4
+ data.tar.gz: 2d1cc37ef31766b96ea9130af1bea8a67ea61315e7b7eb48621f7b8e74359c4c
5
5
  SHA512:
6
- metadata.gz: cf067372afe347c1548d39dbfbf62f7f9788e7c8085239e98d9ed85b95ff3b0ec582f46bfb081cf17a79ebb1046ed0963b7074a1aa00513ebe20ef38444fa776
7
- data.tar.gz: 64b71c9c2218426c1bde27eb04721482a1aeb7233e10d9e0deca9db5c3424f02acf615ecd5d548f5ee08d2ab3a943be74476ac209d8c460042ad8eb301c84541
6
+ metadata.gz: b5d90d4a3f98093f6889f84fa612598cd182f75908bb4fe3b22942e5b20bf3dfe1aaccf0329b18a8f2c5ef965eb4fa1f1195a82258b76dd1e10f2288267a9d4b
7
+ data.tar.gz: 474b056aae94f765deed177fdd54b42c96c03c2bf90144d74c14fb0e44fcc6539bb19092953e164290b0bd7a61e63b3d98cae3993fba40835fa1951924218bda
data/.gitignore CHANGED
@@ -3,6 +3,7 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
+ .env
6
7
  Gemfile.lock
7
8
  InstalledFiles
8
9
  _yardoc
@@ -1,3 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.6.1
4
+
5
+ env:
6
+ - "RAILS_VERSION=5.2.4.3"
7
+ - "RAILS_VERSION=6.0.3"
8
+
data/Gemfile CHANGED
@@ -2,3 +2,17 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in active_force.gemspec
4
4
  gemspec
5
+
6
+ rails_version = ENV["RAILS_VERSION"] || "default"
7
+
8
+ rails = case rails_version
9
+ when "master"
10
+ {github: "rails/rails"}
11
+ when "default"
12
+ ">= 5.2.4.3"
13
+ else
14
+ "~> #{rails_version}"
15
+ end
16
+
17
+ gem "rails", rails
18
+
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
- [![Gem Version](http://img.shields.io/gem/v/active_force.svg)](http://badge.fury.io/rb/active_force)
2
- [![Build Status](http://img.shields.io/travis/ionia-corporation/active_force.svg)](https://travis-ci.org/ionia-corporation/active_force)
3
- [![Test Coverage](https://codeclimate.com/github/ionia-corporation/active_force/badges/coverage.svg)](https://codeclimate.com/github/ionia-corporation/active_force)
4
- [![Inline docs](http://inch-ci.org/github/ionia-corporation/active_force.png?branch=master)](http://inch-ci.org/github/ionia-corporation/active_force)
5
- [![Chat](http://img.shields.io/badge/chat-gitter-brightgreen.svg)](https://gitter.im/ionia-corporation/active_force)
1
+ [![Gem Version](https://img.shields.io/gem/v/openstax_active_force.svg)](http://badge.fury.io/rb/active_force)
2
+ [![Build Status](https://img.shields.io/travis/openstax/active_force.svg)](https://travis-ci.org/openstax/active_force)
3
+ [![Test Coverage](https://codeclimate.com/github/openstax/active_force/badges/coverage.svg)](https://codeclimate.com/github/openstax/active_force)
4
+ [![Inline docs](http://inch-ci.org/github/openstax/active_force.png?branch=master)](http://inch-ci.org/github/openstax/active_force)
5
+ [![Chat](http://img.shields.io/badge/chat-gitter-brightgreen.svg)](https://gitter.im/openstax/active_force)
6
6
 
7
7
  # ActiveForce
8
8
 
@@ -15,12 +15,11 @@ Gem::Specification.new do |spec|
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
18
  spec.require_paths = ["lib"]
20
19
 
21
20
  spec.required_ruby_version = '>= 1.9.3'
22
21
 
23
- spec.add_dependency 'rails', '< 6.0'
22
+ spec.add_dependency 'rails', ">= 5.0", '< 7.0'
24
23
  spec.add_dependency 'active_attr'
25
24
  spec.add_dependency 'restforce'
26
25
 
@@ -23,7 +23,8 @@ module ActiveAttr
23
23
  end
24
24
 
25
25
  def mutations_from_database
26
- @mutations_from_database ||= ActiveModel::NullMutationTracker.instance
26
+ #@mutations_from_database ||= ActiveModel::NullMutationTracker.instance
27
+ @mutations_from_database ||= defined?(ActiveModel::ForcedMutationTracker) ? ActiveModel::ForcedMutationTracker.new(self) : ActiveModel::NullMutationTracker.instance
27
28
  end
28
29
 
29
30
  def forget_attribute_assignments
@@ -75,7 +75,7 @@ module ActiveForce
75
75
 
76
76
  def update_attributes attributes = {}
77
77
  update_attributes! attributes
78
- rescue Faraday::Error::ClientError, RecordInvalid => error
78
+ rescue Faraday::ClientError, RecordInvalid => error
79
79
  handle_save_error error
80
80
  end
81
81
 
@@ -94,7 +94,7 @@ module ActiveForce
94
94
 
95
95
  def create
96
96
  create!
97
- rescue Faraday::Error::ClientError, RecordInvalid => error
97
+ rescue Faraday::ClientError, RecordInvalid => error
98
98
  handle_save_error error
99
99
  self
100
100
  end
@@ -123,7 +123,7 @@ module ActiveForce
123
123
 
124
124
  def save
125
125
  save!
126
- rescue Faraday::Error::ClientError, RecordInvalid => error
126
+ rescue Faraday::ClientError, RecordInvalid => error
127
127
  handle_save_error error
128
128
  end
129
129
 
@@ -1,3 +1,3 @@
1
1
  module ActiveForce
2
- VERSION = "1.0.0"
2
+ VERSION = '1.1.0'
3
3
  end
@@ -140,12 +140,12 @@ describe ActiveForce::SObject do
140
140
  end
141
141
 
142
142
  describe 'and with a ClientError' do
143
- let(:faraday_error){ Faraday::Error::ClientError.new('Some String') }
143
+ let(:faraday_error){ Faraday::ClientError.new('Some String') }
144
144
 
145
145
  before{ expect(client).to receive(:update!).and_raise(faraday_error) }
146
146
 
147
147
  it 'raises an error' do
148
- expect{ instance.update!( text: 'some text', boolean: false ) }.to raise_error(Faraday::Error::ClientError)
148
+ expect{ instance.update!( text: 'some text', boolean: false ) }.to raise_error(Faraday::ClientError)
149
149
  end
150
150
  end
151
151
  end
@@ -198,12 +198,12 @@ describe ActiveForce::SObject do
198
198
  end
199
199
 
200
200
  describe 'and with a ClientError' do
201
- let(:faraday_error){ Faraday::Error::ClientError.new('Some String') }
201
+ let(:faraday_error){ Faraday::ClientError.new('Some String') }
202
202
 
203
203
  before{ expect(client).to receive(:create!).and_raise(faraday_error) }
204
204
 
205
205
  it 'raises an error' do
206
- expect{ instance.create! }.to raise_error(Faraday::Error::ClientError)
206
+ expect{ instance.create! }.to raise_error(Faraday::ClientError)
207
207
  end
208
208
  end
209
209
  end
@@ -314,7 +314,7 @@ describe ActiveForce::SObject do
314
314
  let(:instance){ Whizbang.new }
315
315
 
316
316
  before do
317
- allow(instance).to receive(:create!).and_raise(Faraday::Error::ClientError.new(double))
317
+ allow(instance).to receive(:create!).and_raise(Faraday::ClientError.new(double))
318
318
  end
319
319
 
320
320
  it 'catches and logs the error' do
@@ -335,12 +335,12 @@ describe ActiveForce::SObject do
335
335
  end
336
336
 
337
337
  describe 'and with a ClientError' do
338
- let(:faraday_error){ Faraday::Error::ClientError.new('Some String') }
338
+ let(:faraday_error){ Faraday::ClientError.new('Some String') }
339
339
 
340
340
  before{ expect(client).to receive(:create!).and_raise(faraday_error) }
341
341
 
342
342
  it 'raises an error' do
343
- expect{ instance.save! }.to raise_error(Faraday::Error::ClientError)
343
+ expect{ instance.save! }.to raise_error(Faraday::ClientError)
344
344
  end
345
345
  end
346
346
  end
@@ -366,7 +366,7 @@ describe ActiveForce::SObject do
366
366
  end
367
367
 
368
368
  describe 'and with a ClientError' do
369
- let(:faraday_error){ Faraday::Error::ClientError.new('Some String') }
369
+ let(:faraday_error){ Faraday::ClientError.new('Some String') }
370
370
  before{ expect(client).to receive(:create!).and_raise(faraday_error) }
371
371
  it 'returns false' do
372
372
  expect(instance.save).to eq(false)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstax_active_force
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Espinaco
@@ -13,22 +13,28 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2019-11-06 00:00:00.000000000 Z
16
+ date: 2020-07-01 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: rails
20
20
  requirement: !ruby/object:Gem::Requirement
21
21
  requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: '5.0'
22
25
  - - "<"
23
26
  - !ruby/object:Gem::Version
24
- version: '6.0'
27
+ version: '7.0'
25
28
  type: :runtime
26
29
  prerelease: false
27
30
  version_requirements: !ruby/object:Gem::Requirement
28
31
  requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '5.0'
29
35
  - - "<"
30
36
  - !ruby/object:Gem::Version
31
- version: '6.0'
37
+ version: '7.0'
32
38
  - !ruby/object:Gem::Dependency
33
39
  name: active_attr
34
40
  requirement: !ruby/object:Gem::Requirement
@@ -175,22 +181,4 @@ rubygems_version: 3.0.3
175
181
  signing_key:
176
182
  specification_version: 4
177
183
  summary: Help you implement models persisting on Sales Force within Rails using RESTForce
178
- test_files:
179
- - spec/active_force/active_query_spec.rb
180
- - spec/active_force/association/relation_model_builder_spec.rb
181
- - spec/active_force/association_spec.rb
182
- - spec/active_force/attribute_spec.rb
183
- - spec/active_force/callbacks_spec.rb
184
- - spec/active_force/mapping_spec.rb
185
- - spec/active_force/query_spec.rb
186
- - spec/active_force/sobject/includes_spec.rb
187
- - spec/active_force/sobject/table_name_spec.rb
188
- - spec/active_force/sobject_spec.rb
189
- - spec/active_force/table_spec.rb
190
- - spec/active_force_spec.rb
191
- - spec/fixtures/sobject/single_sobject_hash.yml
192
- - spec/spec_helper.rb
193
- - spec/support/fixture_helpers.rb
194
- - spec/support/restforce_factories.rb
195
- - spec/support/sobjects.rb
196
- - spec/support/whizbang.rb
184
+ test_files: []