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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2bdfa295f55a450caed436ffff2d8b9a6986a1e5
|
4
|
+
data.tar.gz: c3b3f15e4e01c2fe25f22782333a0fde3ec6670a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14554e9715fc52dbab93da0fccc5f37d946254d4a1fad6a15b75cb459d6e1834b4c5b3881032d15f482245b489dd61e78e01747b74360066a83dc42e2d5702d2
|
7
|
+
data.tar.gz: d5b9aea4fecdf6b30bb340397dcf24ae38fca2b8da316dafa461a7349392003d1d8c35f7da8905a1da2900446bb09c6e0f746155fc86a05e87033b23f52ed3de
|
data/CHANGELOG.md
CHANGED
@@ -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
|
data/lib/valkyrie/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|