valkyrie 1.2.0.rc2 → 1.2.0.rc3

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
- SHA256:
3
- metadata.gz: 0ce0917b94c4102aec4a20c07ad0a2d9bb8abbec21c87c91ffe3100ee266e5ee
4
- data.tar.gz: 11ab274a94c6510b0910a5cf16552244eb693daf1bc595c2f9db91480279ca8a
2
+ SHA1:
3
+ metadata.gz: 2bdfa295f55a450caed436ffff2d8b9a6986a1e5
4
+ data.tar.gz: c3b3f15e4e01c2fe25f22782333a0fde3ec6670a
5
5
  SHA512:
6
- metadata.gz: 42c1aa0891d23c99092328e0b9ff7eb8e305c25b3210b9f0d64c0493b6f9ad0c55eb091a2cd481bb4212b3ab8eb148cd3ca949e52963549734dde508a11fa411
7
- data.tar.gz: 30ed893f5b392f4c765950e003aec192039ce3d53147c8428997df492e64836cd47382414b2cd0141eb5f8f265583ad040823c8037144c498ac8e60307b36611
6
+ metadata.gz: 14554e9715fc52dbab93da0fccc5f37d946254d4a1fad6a15b75cb459d6e1834b4c5b3881032d15f482245b489dd61e78e01747b74360066a83dc42e2d5702d2
7
+ data.tar.gz: d5b9aea4fecdf6b30bb340397dcf24ae38fca2b8da316dafa461a7349392003d1d8c35f7da8905a1da2900446bb09c6e0f746155fc86a05e87033b23f52ed3de
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # v1.2.0.RC3 2018-08-15
2
+
3
+ ## Changes since last release
4
+
5
+ * Fix for postgres optimistic locking.
6
+
1
7
  # v1.2.0.RC2 2018-08-10
2
8
 
3
9
  ## Changes since last release
@@ -419,26 +419,6 @@ module Valkyrie::Persistence::Fedora
419
419
  end
420
420
  end
421
421
 
422
- # Casts the value of the RDF literal into an Applicator for Valkyrie::Persistence::OptimisticLockToken objects
423
- # @return [Applicator]
424
- class ValkyrieOptimisticLockToken < ::Valkyrie::ValueMapper
425
- FedoraValue.register(self)
426
-
427
- # Determines whether or not a Property statement is an RDF literal typed for Valkyrie Optimistic Lock Token literals
428
- # @param [Property] value
429
- # @return [Boolean]
430
- def self.handles?(value)
431
- value.statement.object.is_a?(RDF::Literal) && value.statement.object.datatype == PermissiveSchema.optimistic_lock_token
432
- end
433
-
434
- # Casts the value of the RDF literal into an Applicator for Valkyrie::Persistence::OptimisticLockToken objects
435
- # @return [Applicator]
436
- def result
437
- value.statement.object = Valkyrie::Persistence::OptimisticLockToken.new(adapter_id: value.adapter.id, token: value.statement.object.to_s)
438
- calling_mapper.for(Property.new(statement: value.statement, scope: value.scope, adapter: value.adapter)).result
439
- end
440
- end
441
-
442
422
  # Casts the value of the RDF literal into an Applicator for URIs referencing Valkyrie Resources
443
423
  # @return [Applicator]
444
424
  class InternalURI < ::Valkyrie::ValueMapper
@@ -14,6 +14,14 @@ module Valkyrie::Persistence::Postgres
14
14
  # @return [String] Name of {Valkyrie::Resource} model - used for casting.
15
15
  #
16
16
  class Resource < ActiveRecord::Base
17
+ def disable_optimistic_locking!
18
+ @disable_optimistic_locking = true
19
+ end
20
+
21
+ def locking_enabled?
22
+ return false if @disable_optimistic_locking
23
+ true
24
+ end
17
25
  end
18
26
  end
19
27
  end
@@ -19,6 +19,7 @@ module Valkyrie::Persistence::Postgres
19
19
  orm_class.find_or_initialize_by(id: resource.id && resource.id.to_s).tap do |orm_object|
20
20
  orm_object.internal_resource = resource.internal_resource
21
21
  process_lock_token(orm_object)
22
+ orm_object.disable_optimistic_locking! unless resource.optimistic_locking_enabled?
22
23
  orm_object.metadata.merge!(attributes)
23
24
  end
24
25
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Valkyrie
3
- VERSION = "1.2.0.rc2"
3
+ VERSION = "1.2.0.rc3"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valkyrie
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0.rc2
4
+ version: 1.2.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trey Pendragon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-10 00:00:00.000000000 Z
11
+ date: 2018-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -575,7 +575,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
575
575
  version: 1.3.1
576
576
  requirements: []
577
577
  rubyforge_project:
578
- rubygems_version: 2.7.7
578
+ rubygems_version: 2.6.14
579
579
  signing_key:
580
580
  specification_version: 4
581
581
  summary: An ORM using the Data Mapper pattern, specifically built to solve Digital