sufia-models 3.1.3 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/checksum_audit_log.rb +1 -1
- data/app/models/domain_term.rb +1 -1
- data/app/models/local_authority.rb +1 -1
- data/app/models/local_authority_entry.rb +1 -1
- data/app/models/single_use_link.rb +1 -1
- data/app/models/trophy.rb +1 -1
- data/app/models/version_committer.rb +1 -1
- data/lib/generators/sufia/models/install_generator.rb +5 -1
- data/lib/sufia/models/active_record/deprecated_attr_accessible.rb +16 -0
- data/lib/sufia/models/engine.rb +1 -0
- data/lib/sufia/models/generic_file/visibility.rb +26 -24
- data/lib/sufia/models/user.rb +1 -1
- data/lib/sufia/models/version.rb +1 -1
- data/sufia-models.gemspec +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79d76149b1df8f00315c569a3e43db45937c92b7
|
4
|
+
data.tar.gz: 6bd416eab76f790a73f16a07a2abd337cfcd4e4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b776c781c53753d4de08fced94345ed0b45117c63012f8b2042fd18a6633d5c4ac1cb9a2c38cf666b7238b2307de0fd2deffda00db2d14721ec06d66ced04131
|
7
|
+
data.tar.gz: 70e8d9b4d5dc61fac26a93b76a45ca8deb743fec41a396c97b3f51d2a0f705ae5306841f33a9a30717eb1feadf346198dc613abd4f72592e2b4a6176f37e0a89
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class ChecksumAuditLog < ActiveRecord::Base
|
2
|
-
|
2
|
+
deprecated_attr_accessible :pass, :pid, :dsid, :version, :created_at
|
3
3
|
|
4
4
|
def ChecksumAuditLog.get_audit_log(version)
|
5
5
|
ChecksumAuditLog.find_or_create_by_pid_and_dsid_and_version(:pid => version.pid,
|
data/app/models/domain_term.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class DomainTerm < ActiveRecord::Base
|
2
|
-
|
2
|
+
deprecated_attr_accessible :model, :term
|
3
3
|
|
4
4
|
# TODO we should add an index on this join table and remove the uniq query
|
5
5
|
has_and_belongs_to_many :local_authorities, :uniq=> true
|
@@ -2,7 +2,7 @@ require 'rdf'
|
|
2
2
|
require 'rdf/rdfxml'
|
3
3
|
|
4
4
|
class LocalAuthority < ActiveRecord::Base
|
5
|
-
|
5
|
+
deprecated_attr_accessible :name
|
6
6
|
# TODO we should add an index on this join table and remove the uniq query
|
7
7
|
has_and_belongs_to_many :domain_terms, :uniq=> true
|
8
8
|
has_many :local_authority_entries
|
data/app/models/trophy.rb
CHANGED
@@ -92,7 +92,11 @@ This generator makes the following changes to your application:
|
|
92
92
|
private
|
93
93
|
|
94
94
|
def better_migration_template(file)
|
95
|
-
|
95
|
+
begin
|
96
|
+
migration_template "migrations/#{file}", "db/migrate/#{file}"
|
97
|
+
rescue Rails::Generators::Error => e
|
98
|
+
say_status("warning", e.message, :yellow)
|
99
|
+
end
|
96
100
|
end
|
97
101
|
|
98
102
|
end
|
@@ -0,0 +1,16 @@
|
|
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
|
data/lib/sufia/models/engine.rb
CHANGED
@@ -37,6 +37,7 @@ module Sufia
|
|
37
37
|
initializer "patches" do
|
38
38
|
require 'sufia/models/active_fedora/redis'
|
39
39
|
require 'sufia/models/active_record/redis'
|
40
|
+
require 'sufia/models/active_record/deprecated_attr_accessible'
|
40
41
|
require 'sufia/models/active_support/core_ext/marshal' unless Rails::VERSION::MAJOR == 4
|
41
42
|
end
|
42
43
|
|
@@ -3,13 +3,8 @@ module Sufia
|
|
3
3
|
module Visibility
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
extend Deprecation
|
6
|
-
include ActiveModel::Dirty
|
7
6
|
|
8
|
-
|
9
|
-
define_attribute_methods :visibility
|
10
|
-
end
|
11
|
-
|
12
|
-
def visibility= (value)
|
7
|
+
def visibility=(value)
|
13
8
|
return if value.nil?
|
14
9
|
# only set explicit permissions
|
15
10
|
case value
|
@@ -17,7 +12,7 @@ module Sufia
|
|
17
12
|
public_visibility!
|
18
13
|
when Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
|
19
14
|
registered_visibility!
|
20
|
-
when Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
|
15
|
+
when Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
|
21
16
|
private_visibility!
|
22
17
|
else
|
23
18
|
raise ArgumentError, "Invalid visibility: #{value.inspect}"
|
@@ -39,25 +34,32 @@ module Sufia
|
|
39
34
|
self.visibility= visibility
|
40
35
|
end
|
41
36
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC}, "read")
|
46
|
-
end
|
37
|
+
def visibility_changed?
|
38
|
+
@visibility_will_change
|
39
|
+
end
|
47
40
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
41
|
+
private
|
42
|
+
def visibility_will_change!
|
43
|
+
@visibility_will_change = true
|
44
|
+
end
|
45
|
+
|
46
|
+
def public_visibility!
|
47
|
+
visibility_will_change! unless visibility == Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
48
|
+
self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC}, "read")
|
49
|
+
end
|
50
|
+
|
51
|
+
def registered_visibility!
|
52
|
+
visibility_will_change! unless visibility == Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
|
53
|
+
self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_AUTHENTICATED}, "read")
|
54
|
+
self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC}, "none")
|
55
|
+
end
|
56
|
+
|
57
|
+
def private_visibility!
|
58
|
+
visibility_will_change! unless visibility == Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
|
59
|
+
self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_AUTHENTICATED}, "none")
|
60
|
+
self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC}, "none")
|
61
|
+
end
|
53
62
|
|
54
|
-
def private_visibility!
|
55
|
-
visibility_will_change! unless visibility == Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
|
56
|
-
self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_AUTHENTICATED}, "none")
|
57
|
-
self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC}, "none")
|
58
|
-
end
|
59
63
|
end
|
60
64
|
end
|
61
65
|
end
|
62
|
-
|
63
|
-
|
data/lib/sufia/models/user.rb
CHANGED
@@ -19,7 +19,7 @@ module Sufia::User
|
|
19
19
|
acts_as_followable
|
20
20
|
|
21
21
|
# Setup accessible (or protected) attributes for your model
|
22
|
-
|
22
|
+
deprecated_attr_accessible *permitted_attributes
|
23
23
|
|
24
24
|
# Add user avatar (via paperclip library)
|
25
25
|
has_attached_file :avatar, :styles => { medium: "300x300>", thumb: "100x100>" }, :default_url => '/assets/missing_:style.png'
|
data/lib/sufia/models/version.rb
CHANGED
data/sufia-models.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
# This is a temporary homepage until we've had a chance to review the
|
18
18
|
# process
|
19
|
-
spec.homepage = "https://github.com/
|
19
|
+
spec.homepage = "https://github.com/projecthydra/sufia"
|
20
20
|
spec.license = "Apache"
|
21
21
|
|
22
22
|
spec.files = `git ls-files`.split($/)
|
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_dependency 'rails', '>= 3.2.13', '< 5.0'
|
31
31
|
spec.add_dependency 'activeresource' # No longer a dependency of rails 4.0
|
32
32
|
spec.add_dependency "hydra-head", "~> 6.3.0"
|
33
|
-
spec.add_dependency 'active-fedora', "~> 6.
|
33
|
+
spec.add_dependency 'active-fedora', "~> 6.5.0"
|
34
34
|
|
35
35
|
spec.add_dependency 'nest', '~> 1.1.1'
|
36
36
|
spec.add_dependency 'resque', '~> 1.23.0'#, :require => 'resque/server'
|
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.1
|
4
|
+
version: 3.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Friesen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,14 +92,14 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - ~>
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 6.
|
95
|
+
version: 6.5.0
|
96
96
|
type: :runtime
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - ~>
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 6.
|
102
|
+
version: 6.5.0
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: nest
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -281,6 +281,7 @@ files:
|
|
281
281
|
- lib/generators/sufia/models/templates/migrations/create_version_committers.rb
|
282
282
|
- lib/sufia/models.rb
|
283
283
|
- lib/sufia/models/active_fedora/redis.rb
|
284
|
+
- lib/sufia/models/active_record/deprecated_attr_accessible.rb
|
284
285
|
- lib/sufia/models/active_record/redis.rb
|
285
286
|
- lib/sufia/models/active_support/core_ext/marshal.rb
|
286
287
|
- lib/sufia/models/engine.rb
|
@@ -319,7 +320,7 @@ files:
|
|
319
320
|
- lib/tasks/resque.rake
|
320
321
|
- lib/tasks/sufia-models_tasks.rake
|
321
322
|
- sufia-models.gemspec
|
322
|
-
homepage: https://github.com/
|
323
|
+
homepage: https://github.com/projecthydra/sufia
|
323
324
|
licenses:
|
324
325
|
- Apache
|
325
326
|
metadata: {}
|
@@ -339,9 +340,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
339
340
|
version: '0'
|
340
341
|
requirements: []
|
341
342
|
rubyforge_project:
|
342
|
-
rubygems_version: 2.0.
|
343
|
+
rubygems_version: 2.0.3
|
343
344
|
signing_key:
|
344
345
|
specification_version: 4
|
345
346
|
summary: Models and services for sufia
|
346
347
|
test_files: []
|
347
|
-
has_rdoc:
|