enju_subject 0.1.1 → 0.2.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +3 -3
- data/app/controllers/classification_types_controller.rb +13 -2
- data/app/controllers/classifications_controller.rb +12 -3
- data/app/controllers/concerns/enju_subject/controller.rb +27 -0
- data/app/controllers/subject_heading_types_controller.rb +13 -2
- data/app/controllers/subject_types_controller.rb +13 -2
- data/app/controllers/subjects_controller.rb +12 -4
- data/app/models/classification.rb +1 -1
- data/app/models/classification_type.rb +0 -1
- data/app/models/concerns/enju_subject/enju_manifestation.rb +37 -0
- data/app/models/subject.rb +1 -1
- data/app/models/subject_heading_type.rb +0 -1
- data/app/models/subject_type.rb +0 -1
- data/app/policies/classification_policy.rb +21 -0
- data/app/policies/classification_type_policy.rb +23 -0
- data/app/policies/subject_heading_type_policy.rb +23 -0
- data/app/policies/subject_policy.rb +21 -0
- data/app/policies/subject_type_policy.rb +21 -0
- data/app/views/classification_types/index.html.erb +4 -4
- data/app/views/classification_types/show.html.erb +2 -2
- data/app/views/classifications/index.html.erb +2 -2
- data/app/views/classifications/show.html.erb +2 -2
- data/app/views/manifestations/_classification_fields.html.erb +5 -0
- data/app/views/manifestations/_subject_facet.html.erb +2 -2
- data/app/views/manifestations/_subject_fields.html.erb +6 -0
- data/app/views/manifestations/_subject_form.html.erb +8 -9
- data/app/views/subject_heading_types/index.html.erb +4 -4
- data/app/views/subject_heading_types/show.html.erb +2 -2
- data/app/views/subject_types/index.html.erb +4 -4
- data/app/views/subject_types/show.html.erb +2 -2
- data/app/views/subjects/index.html.erb +3 -3
- data/app/views/subjects/index.rss.builder +2 -2
- data/app/views/subjects/show.html.erb +3 -3
- data/db/fixtures/subject_types.yml +4 -4
- data/lib/enju_subject/master_model.rb +3 -3
- data/lib/enju_subject/version.rb +1 -1
- data/lib/enju_subject.rb +0 -29
- data/lib/generators/enju_subject/setup/setup_generator.rb +6 -1
- data/lib/generators/enju_subject/setup/templates/db/fixtures/classification_types.yml +6 -0
- data/lib/generators/enju_subject/setup/templates/db/fixtures/subject_heading_types.yml +6 -6
- data/lib/tasks/enju_subject_tasks.rake +1 -1
- data/spec/controllers/classification_types_controller_spec.rb +13 -13
- data/spec/controllers/classifications_controller_spec.rb +9 -9
- data/spec/controllers/subject_heading_types_controller_spec.rb +58 -58
- data/spec/controllers/subject_types_controller_spec.rb +13 -13
- data/spec/controllers/subjects_controller_spec.rb +9 -9
- data/spec/dummy/app/controllers/application_controller.rb +8 -4
- data/spec/dummy/app/models/user.rb +1 -1
- data/spec/dummy/config/application.rb +5 -24
- data/spec/dummy/config/environments/development.rb +25 -14
- data/spec/dummy/config/environments/production.rb +50 -31
- data/spec/dummy/config/environments/test.rb +23 -18
- data/spec/dummy/config/initializers/enju_leaf.rb +1 -0
- data/spec/dummy/db/schema.rb +2 -1
- data/spec/lib/generators/enju_subject/setup/setup_generator_spec.rb +34 -0
- data/spec/support/devise.rb +2 -1
- metadata +95 -20
- data/app/models/enju_subject/ability.rb +0 -58
- data/lib/enju_subject/manifestation.rb +0 -44
- data/spec/dummy/app/models/ability.rb +0 -59
- data/spec/dummy/config/application.yml +0 -38
- data/spec/dummy/config/initializers/assets.rb +0 -12
@@ -1,30 +1,41 @@
|
|
1
|
-
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
5
|
-
# every request.
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
6
|
# since you don't have to restart the web server when you make code changes.
|
7
7
|
config.cache_classes = false
|
8
8
|
|
9
|
-
#
|
10
|
-
config.
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
11
|
|
12
|
-
# Show full error reports and disable caching
|
12
|
+
# Show full error reports and disable caching.
|
13
13
|
config.consider_all_requests_local = true
|
14
14
|
config.action_controller.perform_caching = false
|
15
15
|
|
16
|
-
# Don't care if the mailer can't send
|
16
|
+
# Don't care if the mailer can't send.
|
17
17
|
config.action_mailer.raise_delivery_errors = false
|
18
18
|
|
19
|
-
# Print deprecation notices to the Rails logger
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
20
|
config.active_support.deprecation = :log
|
21
21
|
|
22
|
-
#
|
23
|
-
config.
|
22
|
+
# Raise an error on page load if there are pending migrations.
|
23
|
+
config.active_record.migration_error = :page_load
|
24
24
|
|
25
|
-
#
|
26
|
-
|
27
|
-
|
28
|
-
# Expands the lines which load the assets
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
26
|
+
# This option may cause significant delays in view rendering with a large
|
27
|
+
# number of complex assets.
|
29
28
|
config.assets.debug = true
|
29
|
+
|
30
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
31
|
+
# yet still be able to expire them through the digest params.
|
32
|
+
config.assets.digest = true
|
33
|
+
|
34
|
+
# Adds additional error checking when serving assets at runtime.
|
35
|
+
# Checks for improperly declared sprockets dependencies.
|
36
|
+
# Raises helpful error messages.
|
37
|
+
config.assets.raise_runtime_errors = true
|
38
|
+
|
39
|
+
# Raises error for missing translations
|
40
|
+
# config.action_view.raise_on_missing_translations = true
|
30
41
|
end
|
@@ -1,60 +1,79 @@
|
|
1
|
-
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
|
-
# Code is not reloaded between requests
|
4
|
+
# Code is not reloaded between requests.
|
5
5
|
config.cache_classes = true
|
6
6
|
|
7
|
-
#
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both threaded web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
8
14
|
config.consider_all_requests_local = false
|
9
15
|
config.action_controller.perform_caching = true
|
10
16
|
|
11
|
-
#
|
12
|
-
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like
|
20
|
+
# NGINX, varnish or squid.
|
21
|
+
# config.action_dispatch.rack_cache = true
|
22
|
+
|
23
|
+
# Disable serving static files from the `/public` folder by default since
|
24
|
+
# Apache or NGINX already handles this.
|
25
|
+
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
13
26
|
|
14
|
-
# Compress JavaScripts and CSS
|
15
|
-
config.assets.
|
27
|
+
# Compress JavaScripts and CSS.
|
28
|
+
config.assets.js_compressor = :uglifier
|
29
|
+
# config.assets.css_compressor = :sass
|
16
30
|
|
17
|
-
#
|
31
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
18
32
|
config.assets.compile = false
|
19
33
|
|
20
|
-
#
|
34
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
35
|
+
# yet still be able to expire them through the digest params.
|
21
36
|
config.assets.digest = true
|
22
37
|
|
23
|
-
#
|
24
|
-
# config.assets.manifest = YOUR_PATH
|
38
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
25
39
|
|
26
|
-
# Specifies the header that your server uses for sending files
|
27
|
-
# config.action_dispatch.x_sendfile_header =
|
28
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for
|
40
|
+
# Specifies the header that your server uses for sending files.
|
41
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
42
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
29
43
|
|
30
44
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
31
45
|
# config.force_ssl = true
|
32
46
|
|
33
|
-
#
|
34
|
-
#
|
47
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
48
|
+
# when problems arise.
|
49
|
+
config.log_level = :debug
|
35
50
|
|
36
|
-
#
|
37
|
-
# config.
|
51
|
+
# Prepend all log lines with the following tags.
|
52
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
38
53
|
|
39
|
-
# Use a different
|
40
|
-
# config.
|
54
|
+
# Use a different logger for distributed setups.
|
55
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
41
56
|
|
42
|
-
#
|
43
|
-
# config.
|
57
|
+
# Use a different cache store in production.
|
58
|
+
# config.cache_store = :mem_cache_store
|
44
59
|
|
45
|
-
#
|
46
|
-
# config.
|
60
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
61
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
47
62
|
|
48
|
-
#
|
63
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
64
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
49
65
|
# config.action_mailer.raise_delivery_errors = false
|
50
66
|
|
51
|
-
# Enable threaded mode
|
52
|
-
# config.threadsafe!
|
53
|
-
|
54
67
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
55
|
-
# the I18n.default_locale when a translation
|
68
|
+
# the I18n.default_locale when a translation cannot be found).
|
56
69
|
config.i18n.fallbacks = true
|
57
70
|
|
58
|
-
# Send deprecation notices to registered listeners
|
71
|
+
# Send deprecation notices to registered listeners.
|
59
72
|
config.active_support.deprecation = :notify
|
73
|
+
|
74
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
75
|
+
config.log_formatter = ::Logger::Formatter.new
|
76
|
+
|
77
|
+
# Do not dump schema after migrations.
|
78
|
+
config.active_record.dump_schema_after_migration = false
|
60
79
|
end
|
@@ -1,39 +1,44 @@
|
|
1
|
-
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
5
|
-
# test suite.
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
6
|
# your test database is "scratch space" for the test suite and is wiped
|
7
|
-
# and recreated between test runs.
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
|
-
#
|
11
|
-
|
12
|
-
|
10
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
11
|
+
# just for the purpose of running a single test. If you are using a tool that
|
12
|
+
# preloads Rails for running tests, you may have to set it to true.
|
13
|
+
config.eager_load = false
|
13
14
|
|
14
|
-
#
|
15
|
-
config.
|
15
|
+
# Configure static file server for tests with Cache-Control for performance.
|
16
|
+
config.serve_static_files = true
|
17
|
+
config.static_cache_control = 'public, max-age=3600'
|
16
18
|
|
17
|
-
# Show full error reports and disable caching
|
19
|
+
# Show full error reports and disable caching.
|
18
20
|
config.consider_all_requests_local = true
|
19
21
|
config.action_controller.perform_caching = false
|
20
22
|
|
21
|
-
# Raise exceptions instead of rendering exception templates
|
23
|
+
# Raise exceptions instead of rendering exception templates.
|
22
24
|
config.action_dispatch.show_exceptions = false
|
23
25
|
|
24
|
-
# Disable request forgery protection in test environment
|
25
|
-
config.action_controller.allow_forgery_protection
|
26
|
+
# Disable request forgery protection in test environment.
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
26
28
|
|
27
29
|
# Tell Action Mailer not to deliver emails to the real world.
|
28
30
|
# The :test delivery method accumulates sent emails in the
|
29
31
|
# ActionMailer::Base.deliveries array.
|
30
32
|
config.action_mailer.delivery_method = :test
|
31
33
|
|
32
|
-
#
|
33
|
-
|
34
|
-
# like if you have constraints or database-specific column types
|
35
|
-
# config.active_record.schema_format = :sql
|
34
|
+
# Randomize the order test cases are executed.
|
35
|
+
config.active_support.test_order = :random
|
36
36
|
|
37
|
-
# Print deprecation notices to the stderr
|
37
|
+
# Print deprecation notices to the stderr.
|
38
38
|
config.active_support.deprecation = :stderr
|
39
|
+
|
40
|
+
# Raises error for missing translations
|
41
|
+
# config.action_view.raise_on_missing_translations = true
|
42
|
+
|
43
|
+
config.action_mailer.default_url_options = {:host => 'localhost:3000'}
|
39
44
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Manifestation.include(EnjuSubject::EnjuManifestation)
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20150925092505) do
|
15
15
|
|
16
16
|
create_table "accepts", force: :cascade do |t|
|
17
17
|
t.integer "basket_id"
|
@@ -228,6 +228,7 @@ ActiveRecord::Schema.define(version: 20150923173139) do
|
|
228
228
|
t.integer "rgt"
|
229
229
|
t.integer "manifestation_id"
|
230
230
|
t.string "url"
|
231
|
+
t.string "label"
|
231
232
|
end
|
232
233
|
|
233
234
|
add_index "classifications", ["category"], name: "index_classifications_on_category"
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require "spec_helper.rb"
|
2
|
+
require "generator_spec"
|
3
|
+
require 'generator_spec/test_case'
|
4
|
+
require 'generators/enju_subject/setup/setup_generator'
|
5
|
+
|
6
|
+
describe EnjuSubject::SetupGenerator, type: :generator do
|
7
|
+
destination File.expand_path("tmp", Rails.root)
|
8
|
+
before(:each) do
|
9
|
+
prepare_destination
|
10
|
+
%w( app/controllers/application_controller.rb config/initializers/enju_leaf.rb ).each do |f|
|
11
|
+
dist_file = "#{Rails.root}/tmp/#{f}"
|
12
|
+
dist_dir = File.dirname(dist_file)
|
13
|
+
mkdir_p dist_dir
|
14
|
+
touch dist_file
|
15
|
+
end
|
16
|
+
run_generator
|
17
|
+
end
|
18
|
+
it "does work" do
|
19
|
+
expect(destination_root).to have_structure do
|
20
|
+
directory "config" do
|
21
|
+
directory "initializers" do
|
22
|
+
file "enju_leaf.rb" do
|
23
|
+
contains "Manifestation.include(EnjuSubject::EnjuManifestation)"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
directory "app" do
|
28
|
+
directory "controllers" do
|
29
|
+
file "application_controller.rb"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/spec/support/devise.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_subject
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kosuke Tanabe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dynamic_form
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: cocoon
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: sqlite3
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,16 +56,16 @@ dependencies:
|
|
42
56
|
name: mysql2
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- - "
|
59
|
+
- - ">="
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
61
|
+
version: '0'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- - "
|
66
|
+
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: pg
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,14 +128,56 @@ dependencies:
|
|
114
128
|
requirements:
|
115
129
|
- - "~>"
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.1
|
131
|
+
version: 1.2.0.beta.1
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
136
|
- - "~>"
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.1
|
138
|
+
version: 1.2.0.beta.1
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: enju_library
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.2.0.beta.1
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 0.2.0.beta.1
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: enju_biblio
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 0.2.0.beta.1
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 0.2.0.beta.1
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: enju_manifestation_viewer
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 0.2.0.beta.1
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: 0.2.0.beta.1
|
125
181
|
- !ruby/object:Gem::Dependency
|
126
182
|
name: sunspot_solr
|
127
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,7 +221,21 @@ dependencies:
|
|
165
221
|
- !ruby/object:Gem::Version
|
166
222
|
version: '0'
|
167
223
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
224
|
+
name: coveralls
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: generator_spec
|
169
239
|
requirement: !ruby/object:Gem::Requirement
|
170
240
|
requirements:
|
171
241
|
- - ">="
|
@@ -190,15 +260,21 @@ files:
|
|
190
260
|
- Rakefile
|
191
261
|
- app/controllers/classification_types_controller.rb
|
192
262
|
- app/controllers/classifications_controller.rb
|
263
|
+
- app/controllers/concerns/enju_subject/controller.rb
|
193
264
|
- app/controllers/subject_heading_types_controller.rb
|
194
265
|
- app/controllers/subject_types_controller.rb
|
195
266
|
- app/controllers/subjects_controller.rb
|
196
267
|
- app/models/classification.rb
|
197
268
|
- app/models/classification_type.rb
|
198
|
-
- app/models/enju_subject/
|
269
|
+
- app/models/concerns/enju_subject/enju_manifestation.rb
|
199
270
|
- app/models/subject.rb
|
200
271
|
- app/models/subject_heading_type.rb
|
201
272
|
- app/models/subject_type.rb
|
273
|
+
- app/policies/classification_policy.rb
|
274
|
+
- app/policies/classification_type_policy.rb
|
275
|
+
- app/policies/subject_heading_type_policy.rb
|
276
|
+
- app/policies/subject_policy.rb
|
277
|
+
- app/policies/subject_type_policy.rb
|
202
278
|
- app/views/classification_types/_form.html.erb
|
203
279
|
- app/views/classification_types/edit.html.erb
|
204
280
|
- app/views/classification_types/index.html.erb
|
@@ -210,8 +286,10 @@ files:
|
|
210
286
|
- app/views/classifications/new.html.erb
|
211
287
|
- app/views/classifications/show.html.erb
|
212
288
|
- app/views/manifestations/_classification_detail.html.erb
|
289
|
+
- app/views/manifestations/_classification_fields.html.erb
|
213
290
|
- app/views/manifestations/_subject_detail.html.erb
|
214
291
|
- app/views/manifestations/_subject_facet.html.erb
|
292
|
+
- app/views/manifestations/_subject_fields.html.erb
|
215
293
|
- app/views/manifestations/_subject_form.html.erb
|
216
294
|
- app/views/subject_heading_types/_form.html.erb
|
217
295
|
- app/views/subject_heading_types/edit.html.erb
|
@@ -250,7 +328,6 @@ files:
|
|
250
328
|
- lib/enju_subject.rb
|
251
329
|
- lib/enju_subject/engine.rb
|
252
330
|
- lib/enju_subject/expire_editable_fragment.rb
|
253
|
-
- lib/enju_subject/manifestation.rb
|
254
331
|
- lib/enju_subject/master_model.rb
|
255
332
|
- lib/enju_subject/page_sweeper.rb
|
256
333
|
- lib/enju_subject/version.rb
|
@@ -272,7 +349,6 @@ files:
|
|
272
349
|
- spec/dummy/app/assets/stylesheets/application.css
|
273
350
|
- spec/dummy/app/controllers/application_controller.rb
|
274
351
|
- spec/dummy/app/helpers/application_helper.rb
|
275
|
-
- spec/dummy/app/models/ability.rb
|
276
352
|
- spec/dummy/app/models/user.rb
|
277
353
|
- spec/dummy/app/views/layouts/application.html.erb
|
278
354
|
- spec/dummy/bin/bundle
|
@@ -281,16 +357,15 @@ files:
|
|
281
357
|
- spec/dummy/bin/setup
|
282
358
|
- spec/dummy/config.ru
|
283
359
|
- spec/dummy/config/application.rb
|
284
|
-
- spec/dummy/config/application.yml
|
285
360
|
- spec/dummy/config/boot.rb
|
286
361
|
- spec/dummy/config/database.yml
|
287
362
|
- spec/dummy/config/environment.rb
|
288
363
|
- spec/dummy/config/environments/development.rb
|
289
364
|
- spec/dummy/config/environments/production.rb
|
290
365
|
- spec/dummy/config/environments/test.rb
|
291
|
-
- spec/dummy/config/initializers/assets.rb
|
292
366
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
293
367
|
- spec/dummy/config/initializers/devise.rb
|
368
|
+
- spec/dummy/config/initializers/enju_leaf.rb
|
294
369
|
- spec/dummy/config/initializers/inflections.rb
|
295
370
|
- spec/dummy/config/initializers/mime_types.rb
|
296
371
|
- spec/dummy/config/initializers/secret_token.rb
|
@@ -462,6 +537,7 @@ files:
|
|
462
537
|
- spec/fixtures/user_groups.yml
|
463
538
|
- spec/fixtures/user_has_roles.yml
|
464
539
|
- spec/fixtures/users.yml
|
540
|
+
- spec/lib/generators/enju_subject/setup/setup_generator_spec.rb
|
465
541
|
- spec/models/classification_spec.rb
|
466
542
|
- spec/models/classification_type_spec.rb
|
467
543
|
- spec/models/subject_heading_type_spec.rb
|
@@ -488,12 +564,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
488
564
|
version: '0'
|
489
565
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
490
566
|
requirements:
|
491
|
-
- - "
|
567
|
+
- - ">"
|
492
568
|
- !ruby/object:Gem::Version
|
493
|
-
version:
|
569
|
+
version: 1.3.1
|
494
570
|
requirements: []
|
495
571
|
rubyforge_project:
|
496
|
-
rubygems_version: 2.5.
|
572
|
+
rubygems_version: 2.5.1
|
497
573
|
signing_key:
|
498
574
|
specification_version: 4
|
499
575
|
summary: enju_subject plugin
|
@@ -507,7 +583,6 @@ test_files:
|
|
507
583
|
- spec/dummy/app/assets/stylesheets/application.css
|
508
584
|
- spec/dummy/app/controllers/application_controller.rb
|
509
585
|
- spec/dummy/app/helpers/application_helper.rb
|
510
|
-
- spec/dummy/app/models/ability.rb
|
511
586
|
- spec/dummy/app/models/user.rb
|
512
587
|
- spec/dummy/app/views/layouts/application.html.erb
|
513
588
|
- spec/dummy/bin/bundle
|
@@ -515,16 +590,15 @@ test_files:
|
|
515
590
|
- spec/dummy/bin/rake
|
516
591
|
- spec/dummy/bin/setup
|
517
592
|
- spec/dummy/config/application.rb
|
518
|
-
- spec/dummy/config/application.yml
|
519
593
|
- spec/dummy/config/boot.rb
|
520
594
|
- spec/dummy/config/database.yml
|
521
595
|
- spec/dummy/config/environment.rb
|
522
596
|
- spec/dummy/config/environments/development.rb
|
523
597
|
- spec/dummy/config/environments/production.rb
|
524
598
|
- spec/dummy/config/environments/test.rb
|
525
|
-
- spec/dummy/config/initializers/assets.rb
|
526
599
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
527
600
|
- spec/dummy/config/initializers/devise.rb
|
601
|
+
- spec/dummy/config/initializers/enju_leaf.rb
|
528
602
|
- spec/dummy/config/initializers/inflections.rb
|
529
603
|
- spec/dummy/config/initializers/mime_types.rb
|
530
604
|
- spec/dummy/config/initializers/secret_token.rb
|
@@ -698,6 +772,7 @@ test_files:
|
|
698
772
|
- spec/fixtures/user_groups.yml
|
699
773
|
- spec/fixtures/user_has_roles.yml
|
700
774
|
- spec/fixtures/users.yml
|
775
|
+
- spec/lib/generators/enju_subject/setup/setup_generator_spec.rb
|
701
776
|
- spec/models/classification_spec.rb
|
702
777
|
- spec/models/classification_type_spec.rb
|
703
778
|
- spec/models/subject_heading_type_spec.rb
|
@@ -1,58 +0,0 @@
|
|
1
|
-
module EnjuSubject
|
2
|
-
class Ability
|
3
|
-
include CanCan::Ability
|
4
|
-
|
5
|
-
def initialize(user, ip_address = nil)
|
6
|
-
case user.try(:role).try(:name)
|
7
|
-
when 'Administrator'
|
8
|
-
can :manage, [
|
9
|
-
Classification,
|
10
|
-
Subject
|
11
|
-
]
|
12
|
-
if LibraryGroup.site_config.network_access_allowed?(ip_address)
|
13
|
-
can [:read, :create, :update], ClassificationType
|
14
|
-
can [:destroy, :delete], ClassificationType do |classification_type|
|
15
|
-
classification_type.classifications.empty?
|
16
|
-
end
|
17
|
-
can [:read, :create, :update], SubjectHeadingType
|
18
|
-
can [:destroy, :delete], SubjectHeadingType do |subject_heading_type|
|
19
|
-
subject_heading_type.subjects.empty?
|
20
|
-
end
|
21
|
-
can :manage, [
|
22
|
-
Classification,
|
23
|
-
Subject,
|
24
|
-
SubjectType
|
25
|
-
]
|
26
|
-
else
|
27
|
-
can :read, [
|
28
|
-
ClassificationType,
|
29
|
-
SubjectHeadingType,
|
30
|
-
SubjectType
|
31
|
-
]
|
32
|
-
end
|
33
|
-
when 'Librarian'
|
34
|
-
can :read, [
|
35
|
-
Classification,
|
36
|
-
ClassificationType,
|
37
|
-
Subject,
|
38
|
-
SubjectType,
|
39
|
-
SubjectHeadingType
|
40
|
-
]
|
41
|
-
when 'User'
|
42
|
-
can :read, [
|
43
|
-
Classification,
|
44
|
-
ClassificationType,
|
45
|
-
Subject,
|
46
|
-
SubjectHeadingType
|
47
|
-
]
|
48
|
-
else
|
49
|
-
can :read, [
|
50
|
-
Classification,
|
51
|
-
ClassificationType,
|
52
|
-
Subject,
|
53
|
-
SubjectHeadingType
|
54
|
-
]
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
module EnjuSubject
|
2
|
-
module EnjuManifestation
|
3
|
-
def self.included(base)
|
4
|
-
base.extend ClassMethods
|
5
|
-
end
|
6
|
-
|
7
|
-
module ClassMethods
|
8
|
-
def enju_subject_manifestation_model
|
9
|
-
include InstanceMethods
|
10
|
-
has_many :subjects
|
11
|
-
has_many :classifications
|
12
|
-
accepts_nested_attributes_for :subjects, :allow_destroy => true, :reject_if => :all_blank
|
13
|
-
accepts_nested_attributes_for :classifications, :allow_destroy => true, :reject_if => :all_blank
|
14
|
-
after_save do
|
15
|
-
subject_index!
|
16
|
-
end
|
17
|
-
after_destroy do
|
18
|
-
subject_index!
|
19
|
-
end
|
20
|
-
|
21
|
-
searchable do
|
22
|
-
text :subject do
|
23
|
-
subjects.map{|s| [s.term, s.term_transcription]}.flatten.compact
|
24
|
-
end
|
25
|
-
string :subject, :multiple => true do
|
26
|
-
subjects.map{|s| [s.term, s.term_transcription]}.flatten.compact
|
27
|
-
end
|
28
|
-
string :classification, :multiple => true do
|
29
|
-
classifications.map{|c| "#{c.classification_type.name}_#{c.category}"}
|
30
|
-
end
|
31
|
-
integer :subject_ids, :multiple => true
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
module InstanceMethods
|
36
|
-
def subject_index!
|
37
|
-
subjects.map{|subject| subject.index}
|
38
|
-
classifications.map{|classification| classification.index}
|
39
|
-
Sunspot.commit
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|