sufia-models 3.7.1 → 3.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/geo_names_resource.rb +4 -4
- data/lib/sufia/models/generic_file.rb +2 -0
- data/lib/sufia/models/generic_file/reload_on_save.rb +18 -0
- data/lib/sufia/models/jobs/active_fedora_pid_based_job.rb +1 -1
- data/lib/sufia/models/version.rb +1 -1
- data/sufia-models.gemspec +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46955d1e4d943f5aa48af13600bf6315f7de2246
|
4
|
+
data.tar.gz: c024b0bc111898801fe776e72df994964ca34b93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81d45bb938a76994c7f84fb30093d53421004930a809a3782932eb9bee52dd6a250f42de784ade74b3d70e806ce976df4a86af7d1f21a0876bd782d212346fcd
|
7
|
+
data.tar.gz: 0d69c56dc6ceab560b4d98642bfb7976c03cd4d06cd3455bb71a771cecf1d70d8a9b8b150963e3a55b5e0e9860bc51bb3ee66bcf9930206d6ed37090f232af93
|
@@ -5,10 +5,10 @@ class GeoNamesResource < ActiveResource::Base
|
|
5
5
|
|
6
6
|
def self.collection_path(prefix_options = {}, query_options = nil)
|
7
7
|
super(prefix_options, query_options).gsub(/\.json|\.xml/, "")
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.instantiate_collection(collection, prefix_options = {})
|
11
|
-
col = super(collection["geonames"],prefix_options)
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.instantiate_collection(collection, original_params = {}, prefix_options = {})
|
11
|
+
col = super(collection["geonames"], original_params, prefix_options)
|
12
12
|
col.map! {|item| { label: item.name+ (item.adminName1 ? ", " + item.adminName1 : "")+", " + item.countryName, value: item.name+ (item.adminName1 ? ", " + item.adminName1 : "")+", " + item.countryName} }
|
13
13
|
return col
|
14
14
|
end
|
@@ -11,6 +11,7 @@ module Sufia
|
|
11
11
|
autoload :Metadata, 'sufia/models/generic_file/metadata'
|
12
12
|
autoload :Versions, 'sufia/models/generic_file/versions'
|
13
13
|
autoload :VirusCheck, 'sufia/models/generic_file/virus_check'
|
14
|
+
autoload :ReloadOnSave, 'sufia/models/generic_file/reload_on_save'
|
14
15
|
include Sufia::ModelMethods
|
15
16
|
include Sufia::Noid
|
16
17
|
include Sufia::GenericFile::MimeTypes
|
@@ -25,6 +26,7 @@ module Sufia
|
|
25
26
|
include Sufia::GenericFile::Metadata
|
26
27
|
include Sufia::GenericFile::Versions
|
27
28
|
include Sufia::GenericFile::VirusCheck
|
29
|
+
include Sufia::GenericFile::ReloadOnSave
|
28
30
|
|
29
31
|
included do
|
30
32
|
belongs_to :batch, :property => :is_part_of
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# add this in here until we can use a version of Active Fedora that contains this ability
|
2
|
+
module Sufia
|
3
|
+
module GenericFile
|
4
|
+
module ReloadOnSave
|
5
|
+
|
6
|
+
attr_writer :reload_on_save
|
7
|
+
|
8
|
+
def reload_on_save?
|
9
|
+
!!@reload_on_save
|
10
|
+
end
|
11
|
+
|
12
|
+
def refresh
|
13
|
+
self.reload if reload_on_save?
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
@@ -8,7 +8,7 @@ class ActiveFedoraPidBasedJob
|
|
8
8
|
self.pid = pid
|
9
9
|
end
|
10
10
|
def object
|
11
|
-
@object ||= ActiveFedora::Base.find(pid, cast:true)
|
11
|
+
@object ||= ActiveFedora::Base.find(pid, cast:true).tap{|f| f.reload_on_save = true}
|
12
12
|
end
|
13
13
|
alias_method :generic_file, :object
|
14
14
|
alias_method :generic_file_id, :pid
|
data/lib/sufia/models/version.rb
CHANGED
data/sufia-models.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency "rake"
|
28
28
|
|
29
29
|
spec.add_dependency 'rails', '> 4.0.0', '< 5.0'
|
30
|
-
spec.add_dependency 'activeresource' # No longer a dependency of rails 4.0
|
30
|
+
spec.add_dependency 'activeresource', "~>4.0.0" # No longer a dependency of rails 4.0
|
31
31
|
|
32
32
|
spec.add_dependency "blacklight", "~> 4.7.0"
|
33
33
|
spec.add_dependency "hydra-head", "~> 6.5.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sufia-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.7.
|
4
|
+
version: 3.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Friesen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -62,16 +62,16 @@ dependencies:
|
|
62
62
|
name: activeresource
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- -
|
65
|
+
- - ~>
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
67
|
+
version: 4.0.0
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- -
|
72
|
+
- - ~>
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
74
|
+
version: 4.0.0
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: blacklight
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -317,6 +317,7 @@ files:
|
|
317
317
|
- lib/sufia/models/generic_file/metadata.rb
|
318
318
|
- lib/sufia/models/generic_file/mime_types.rb
|
319
319
|
- lib/sufia/models/generic_file/permissions.rb
|
320
|
+
- lib/sufia/models/generic_file/reload_on_save.rb
|
320
321
|
- lib/sufia/models/generic_file/thumbnail.rb
|
321
322
|
- lib/sufia/models/generic_file/trophies.rb
|
322
323
|
- lib/sufia/models/generic_file/versions.rb
|