bsm-sso-client 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,14 +27,13 @@ module Bsm::Sso::Client::Cached::ActiveRecord
27
27
 
28
28
  # Cache!
29
29
  def sso_cache(resource, action = nil)
30
- if record = where(id: resource.id).first
31
- record.attributes = resource.attributes.slice(*record.attribute_names)
32
- record.changed? ? record.save! : record.touch
33
- record
34
- else
35
- create!(resource.attributes)
36
- end
30
+ record = where(id: resource.id).first_or_initialize
31
+ attrs = [resource.attributes.slice(*record.attribute_names)]
32
+ attrs << {without_protection: true} if defined?(ProtectedAttributes)
33
+ record.assign_attributes(*attrs)
34
+ record.changed? ? record.save! : record.touch
35
+ record
37
36
  end
38
37
 
39
38
  end
40
- end
39
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bsm-sso-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-03 00:00:00.000000000 Z
12
+ date: 2013-07-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -235,6 +235,22 @@ dependencies:
235
235
  - - ! '>='
236
236
  - !ruby/object:Gem::Version
237
237
  version: '0'
238
+ - !ruby/object:Gem::Dependency
239
+ name: protected_attributes
240
+ requirement: !ruby/object:Gem::Requirement
241
+ none: false
242
+ requirements:
243
+ - - ! '>='
244
+ - !ruby/object:Gem::Version
245
+ version: '0'
246
+ type: :development
247
+ prerelease: false
248
+ version_requirements: !ruby/object:Gem::Requirement
249
+ none: false
250
+ requirements:
251
+ - - ! '>='
252
+ - !ruby/object:Gem::Version
253
+ version: '0'
238
254
  description: ''
239
255
  email: dimitrij@blacksquaremedia.com
240
256
  executables: []