sync_attr_with_auth0 0.0.20 → 0.0.21

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
  SHA1:
3
- metadata.gz: 0fb1101e092bccf7062ac9ca3a6f02e351c94ef5
4
- data.tar.gz: d12bca90a91da479fa0834d320a2742afbe0259f
3
+ metadata.gz: e79727fa97e9f637b4e9922291ebb92de96d0678
4
+ data.tar.gz: 9e5c0a922d5d3b8a3f15b5da66f98090978d56d7
5
5
  SHA512:
6
- metadata.gz: ce1e10fbb37dfaf2371dbb9931485ac13ce85d4dbf496978de9d5345100c23f24d16782f6e82a92847d67a183613cfdaef3c0562b93c6af71e329b57e977abe9
7
- data.tar.gz: d00fdd4c41d1235fe2ea36207cb3527e5c9c47face0872c8431af2b89ebadb7a17412ba9e3136484d5ec7e289137f180885437d7e642500024563dca3391f75e
6
+ metadata.gz: fe728e2b3be857226ededc06b5f42b6b1161a4cfed6732e599ddda97664f73c94b2a2d3743b858a2a8e5a7c2cd55cc21d23bf2a0318220054193f4d6bd55e06e
7
+ data.tar.gz: de2c6b0565dbb707f68894e3207d65661b9fa2a17cb5bd1c67da92de48d465bc969b547d441a04b59fddf6b4ec60802785c5707dad7c9e64e5af8f6c3498cda9
@@ -14,7 +14,7 @@ module SyncAttrWithAuth0
14
14
 
15
15
  after_validation :validate_email_with_auth0
16
16
  after_create :auth0_create
17
- after_update :auth0_update
17
+ after_update :auth0_update, if: :auth0_dirty?
18
18
  end
19
19
 
20
20
  private
@@ -167,7 +167,6 @@ module SyncAttrWithAuth0
167
167
  auth0.patch_user(uid, args)
168
168
 
169
169
  rescue ::Auth0::NotFound => e
170
- # TODO: We need to attempt to find the correct UID by email or nil the UID on the user.
171
170
  response = find_user_in_auth0
172
171
  found_user = response.first
173
172
 
@@ -234,5 +233,11 @@ module SyncAttrWithAuth0
234
233
  return user_metadata
235
234
  end
236
235
 
236
+ def auth0_dirty?
237
+ !!(auth0_sync_options[:sync_atts].inject(false) do |memo, attrib|
238
+ memo || try("#{attrib}_changed?")
239
+ end)
240
+ end
241
+
237
242
  end
238
243
  end
metadata CHANGED
@@ -1,10 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sync_attr_with_auth0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick McGraw
8
+ - Mike Oliver
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
@@ -166,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
167
  version: '0'
167
168
  requirements: []
168
169
  rubyforge_project:
169
- rubygems_version: 2.4.6
170
+ rubygems_version: 2.4.5
170
171
  signing_key:
171
172
  specification_version: 4
172
173
  summary: Synchronize attributes on a local ActiveRecord user model with the user metadata