sufia-models 3.6.1 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/checksum_audit_log.rb +0 -1
- data/app/models/concerns/sufia/user.rb +6 -13
- data/app/models/domain_term.rb +1 -6
- data/app/models/local_authority.rb +2 -10
- data/app/models/local_authority_entry.rb +0 -1
- data/app/models/single_use_link.rb +1 -3
- data/app/models/trophy.rb +0 -2
- data/app/models/version_committer.rb +0 -1
- data/lib/sufia/models/engine.rb +0 -2
- data/lib/sufia/models/generic_file.rb +7 -0
- data/sufia-models.gemspec +3 -1
- metadata +36 -11
- data/lib/sufia/models/active_record/deprecated_attr_accessible.rb +0 -16
- data/lib/sufia/models/active_support/core_ext/marshal.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cb48f360a3de57734b84c5b0cdbe19d0c154647
|
4
|
+
data.tar.gz: 1c3ad7ad44e77895928cc74957937fe9531a6cda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bffefa6d93acc03739d56c2cb096f61dee07d70382e919f9aa2090626f559dde23fec752cc355864e84b9e505ffa5c1b8dc2f90338d07da14dbb91751f8f46f
|
7
|
+
data.tar.gz: 51de07fcc95c76d75acbf231057697ff9c782efa7620f802e794ec097f3fb9662c55f15397fdd09a2dae96832e71eeb07951f456e74a5b63dc4b4b5f9602a2e9
|
@@ -18,11 +18,9 @@ module Sufia::User
|
|
18
18
|
# Users should be followable
|
19
19
|
acts_as_followable
|
20
20
|
|
21
|
-
# Setup accessible (or protected) attributes for your model
|
22
|
-
deprecated_attr_accessible *permitted_attributes
|
23
|
-
|
24
21
|
mount_uploader :avatar, AvatarUploader, :mount_on => :avatar_file_name
|
25
22
|
validates_with AvatarValidator
|
23
|
+
has_many :trophies
|
26
24
|
end
|
27
25
|
|
28
26
|
# Format the json for select2 which requires just an id and a field called text.
|
@@ -45,15 +43,10 @@ module Sufia::User
|
|
45
43
|
user_key.gsub(/\./, '-dot-')
|
46
44
|
end
|
47
45
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
#method to get the trophy ids without the namespace included
|
55
|
-
def trophy_ids
|
56
|
-
trophies.map { |t| "#{Sufia.config.id_namespace}:#{t.generic_file_id}" }
|
46
|
+
def trophy_files
|
47
|
+
trophies.map do |t|
|
48
|
+
GenericFile.load_instance_from_solr(Sufia::Noid.namespaceize(t.generic_file_id))
|
49
|
+
end
|
57
50
|
end
|
58
51
|
|
59
52
|
# method needed for messaging
|
@@ -76,7 +69,7 @@ module Sufia::User
|
|
76
69
|
[:email, :login, :display_name, :address, :admin_area,
|
77
70
|
:department, :title, :office, :chat_id, :website, :affiliation,
|
78
71
|
:telephone, :avatar, :group_list, :groups_last_update, :facebook_handle,
|
79
|
-
:twitter_handle, :googleplus_handle]
|
72
|
+
:twitter_handle, :googleplus_handle, :linkedin_handle]
|
80
73
|
end
|
81
74
|
|
82
75
|
def current
|
data/app/models/domain_term.rb
CHANGED
@@ -1,10 +1,5 @@
|
|
1
1
|
class DomainTerm < ActiveRecord::Base
|
2
|
-
deprecated_attr_accessible :model, :term
|
3
2
|
|
4
3
|
# TODO we should add an index on this join table and remove the uniq query
|
5
|
-
|
6
|
-
has_and_belongs_to_many :local_authorities, -> {uniq}
|
7
|
-
else
|
8
|
-
has_and_belongs_to_many :local_authorities, :uniq=> true
|
9
|
-
end
|
4
|
+
has_and_belongs_to_many :local_authorities, -> {uniq}
|
10
5
|
end
|
@@ -1,15 +1,7 @@
|
|
1
|
-
require 'rdf'
|
2
|
-
require 'rdf/rdfxml'
|
3
|
-
|
4
1
|
class LocalAuthority < ActiveRecord::Base
|
5
|
-
deprecated_attr_accessible :name
|
6
2
|
|
7
|
-
|
8
|
-
|
9
|
-
has_and_belongs_to_many :domain_terms, -> { uniq }
|
10
|
-
else
|
11
|
-
has_and_belongs_to_many :domain_terms, :uniq=> true
|
12
|
-
end
|
3
|
+
# TODO we should add an index on this join table and remove the uniq query
|
4
|
+
has_and_belongs_to_many :domain_terms, -> { uniq }
|
13
5
|
|
14
6
|
has_many :local_authority_entries
|
15
7
|
|
@@ -1,7 +1,5 @@
|
|
1
1
|
class SingleUseLink < ActiveRecord::Base
|
2
2
|
|
3
|
-
deprecated_attr_accessible :downloadKey, :path, :expires, :itemId
|
4
|
-
|
5
3
|
validate :expiration_date_cannot_be_in_the_past
|
6
4
|
validate :cannot_be_destroyed
|
7
5
|
|
@@ -41,4 +39,4 @@ class SingleUseLink < ActiveRecord::Base
|
|
41
39
|
end
|
42
40
|
end
|
43
41
|
|
44
|
-
end
|
42
|
+
end
|
data/app/models/trophy.rb
CHANGED
data/lib/sufia/models/engine.rb
CHANGED
@@ -38,8 +38,6 @@ module Sufia
|
|
38
38
|
initializer "patches" do
|
39
39
|
require 'sufia/models/active_fedora/redis'
|
40
40
|
require 'sufia/models/active_record/redis'
|
41
|
-
require 'sufia/models/active_record/deprecated_attr_accessible'
|
42
|
-
require 'sufia/models/active_support/core_ext/marshal' unless Rails::VERSION::MAJOR == 4
|
43
41
|
end
|
44
42
|
|
45
43
|
initializer 'requires' do
|
@@ -69,6 +69,13 @@ module Sufia
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
+
# Get the files with a sibling relationship (belongs_to :batch)
|
73
|
+
# The batch id is minted when visiting the upload screen and attached
|
74
|
+
# to each file when it is done uploading. The Batch object is not created
|
75
|
+
# until all objects are done uploading and the user is redirected to
|
76
|
+
# BatchController#edit. Therefore, we must handle the case where
|
77
|
+
# self.batch_id is set but self.batch returns nil.
|
78
|
+
# This can get a major overhaul with ActiveFedora 7
|
72
79
|
def related_files
|
73
80
|
relateds = begin
|
74
81
|
self.batch.generic_files
|
data/sufia-models.gemspec
CHANGED
@@ -29,7 +29,9 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_dependency 'rails', '> 4.0.0', '< 5.0'
|
30
30
|
spec.add_dependency 'activeresource' # No longer a dependency of rails 4.0
|
31
31
|
|
32
|
-
spec.add_dependency "
|
32
|
+
spec.add_dependency "blacklight", "~> 4.7.0"
|
33
|
+
spec.add_dependency "hydra-head", "~> 6.4.1"
|
34
|
+
spec.add_dependency "rubydora", "~> 1.7.0"
|
33
35
|
spec.add_dependency 'nest', '~> 1.1.1'
|
34
36
|
spec.add_dependency 'resque', '~> 1.23'
|
35
37
|
spec.add_dependency 'resque-pool', '0.3.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.
|
4
|
+
version: 3.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Friesen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -73,19 +73,47 @@ dependencies:
|
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
76
|
+
name: blacklight
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- -
|
79
|
+
- - ~>
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
81
|
+
version: 4.7.0
|
82
82
|
type: :runtime
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- -
|
86
|
+
- - ~>
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 4.7.0
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: hydra-head
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ~>
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 6.4.1
|
96
|
+
type: :runtime
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ~>
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 6.4.1
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: rubydora
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.7.0
|
110
|
+
type: :runtime
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ~>
|
87
115
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
116
|
+
version: 1.7.0
|
89
117
|
- !ruby/object:Gem::Dependency
|
90
118
|
name: nest
|
91
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -275,9 +303,7 @@ files:
|
|
275
303
|
- lib/generators/sufia/models/templates/migrations/create_version_committers.rb
|
276
304
|
- lib/sufia/models.rb
|
277
305
|
- lib/sufia/models/active_fedora/redis.rb
|
278
|
-
- lib/sufia/models/active_record/deprecated_attr_accessible.rb
|
279
306
|
- lib/sufia/models/active_record/redis.rb
|
280
|
-
- lib/sufia/models/active_support/core_ext/marshal.rb
|
281
307
|
- lib/sufia/models/engine.rb
|
282
308
|
- lib/sufia/models/file_content.rb
|
283
309
|
- lib/sufia/models/file_content/versions.rb
|
@@ -335,9 +361,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
335
361
|
version: '0'
|
336
362
|
requirements: []
|
337
363
|
rubyforge_project:
|
338
|
-
rubygems_version: 2.1
|
364
|
+
rubygems_version: 2.2.1
|
339
365
|
signing_key:
|
340
366
|
specification_version: 4
|
341
367
|
summary: Models and services for sufia
|
342
368
|
test_files: []
|
343
|
-
has_rdoc:
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module ActiveRecord
|
2
|
-
module DeprecatedAttrAccessible
|
3
|
-
extend ActiveSupport::Concern
|
4
|
-
module ClassMethods
|
5
|
-
def deprecated_attr_accessible(*args)
|
6
|
-
if Rails::VERSION::MAJOR < 4 || defined?(ProtectedAttributes)
|
7
|
-
ActiveSupport::Deprecation.warn("deprecated_attr_accessible is, wait for it, deprecated. It will be removed when Sufia stops support Rails 3.")
|
8
|
-
attr_accessible(*args)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
ActiveRecord::Base.class_eval do
|
15
|
-
include ActiveRecord::DeprecatedAttrAccessible
|
16
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
### This patch is going into active-support (rails 4). https://github.com/rails/rails/pull/8246
|
2
|
-
module Marshal
|
3
|
-
class << self
|
4
|
-
def load_with_autoloading(source)
|
5
|
-
begin
|
6
|
-
load_without_autoloading(source)
|
7
|
-
rescue ArgumentError, NameError => exc
|
8
|
-
if exc.message.match(%r|undefined class/module (.+)|)
|
9
|
-
# try loading the class/module
|
10
|
-
$1.constantize
|
11
|
-
# if it is a IO we need to go back to read the object
|
12
|
-
source.rewind if source.respond_to?(:rewind)
|
13
|
-
retry
|
14
|
-
else
|
15
|
-
raise exc
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
alias_method_chain :load, :autoloading
|
21
|
-
end
|
22
|
-
end
|