active-fedora 9.0.0.beta1 → 9.0.0.beta2

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: 23fac3b5c068cdb6deef749ef858f484dc5e5e6d
4
- data.tar.gz: d8b17b361ea94983e72bcbaad7625600389cf05f
3
+ metadata.gz: d60ea93eeb279f9295e64e08e725c95cf5bea026
4
+ data.tar.gz: 625d2f73009486e3d60b2491a81589f13b11ab4c
5
5
  SHA512:
6
- metadata.gz: f17f40b3dee2c5d3944fe722bb716726d27da32144c6445cda25e83076ad9a3c3122ea32e1e687cf2431eee90721a32a6cad7ffebccf8c6ab0f4c89992013854
7
- data.tar.gz: ff15b6b7406fccac6f782e488bef7ea595aef525af56f38a2dd1f5fee0b63f16d4511fa79414297022a4baaca171a5a969864b2f39b293286d4f91e149467bd4
6
+ metadata.gz: d438e3f43b8b128c721fb4c984ecce6fb8d250fa473ec85e586b51913f2fd27105a74bb8773249e74028c1955d6e882469acf6af2708d35526ab21328c034f6e
7
+ data.tar.gz: 0a7739691a954a784416251ec56322e7ce3ade16b7387d1d7c1476dcc6141dc54f545a4218f438e18c3c26e0f48b6aa3c4de5590af2a6b2fdc7ea88544094e0d
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "9.0.0.beta1"
2
+ VERSION = "9.0.0.beta2"
3
3
  end
@@ -12,8 +12,6 @@ module ActiveFedora
12
12
  end
13
13
  end
14
14
 
15
- # TODO: This only applies to objects. If we want the same for child resources, it would need to go
16
- # under fcr:metadata
17
15
  def model_type
18
16
  if self.respond_to?(:metadata)
19
17
  metadata.ldp_source.graph.query(predicate: ::RDF.type).objects
@@ -22,9 +20,11 @@ module ActiveFedora
22
20
  end
23
21
  end
24
22
 
23
+ # Returns an array of RDF::Literal objects where the version label matches
24
+ # our own version label and excludes auto-snapshot versions from Fedora.
25
25
  def versions
26
26
  results = versions_graph.query([nil, ::RDF::URI.new('http://fedora.info/definitions/v4/repository#hasVersionLabel'), nil])
27
- results.map(&:object)
27
+ numbered_versions(results)
28
28
  end
29
29
 
30
30
  def versions_graph
@@ -86,5 +86,12 @@ module ActiveFedora
86
86
  end
87
87
  end
88
88
 
89
+ def numbered_versions statements, literals = Array.new
90
+ statements.each do |statement|
91
+ literals << statement.object unless statement.object.to_s.match("auto-snapshot")
92
+ end
93
+ return literals
94
+ end
95
+
89
96
  end
90
97
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-fedora
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.0.beta1
4
+ version: 9.0.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Zumwalt
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-11-15 00:00:00.000000000 Z
13
+ date: 2014-11-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsolr