enju_search_log 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46e6aec13d934ea71c3b44757f1a20167274767c
4
- data.tar.gz: b5441f199bbe72780b2e07bd46f4feba4ea241e4
3
+ metadata.gz: 1183581c4daeef762ecb81966d886fc952f36861
4
+ data.tar.gz: c9de2625233b2d9ecfef6c9fdf0c21becf06e38e
5
5
  SHA512:
6
- metadata.gz: b99505d169c7980b86949658034b7710ef6d0d505ade0611d07a147ee54eb0fca19088237732258c9255205b35a4b0f4ffbceb1e066d796d8c71940580ce36ac
7
- data.tar.gz: e012c520408c53273b469334aa0f55fef3dbafe81ad3aa1fd2e1e07f3929166ff3b587683631cfbc76cb46390c64c69b9c209b83460d02a75b8a5be7371a4a83
6
+ metadata.gz: 5a748e7617bcc8d471b6696c41de6f1a32a26d9c732b12efef16b57df6e339dd6cc707db1d081a53d4111f9dfa913a2f9c170d8d01c2ed4f7e4b5da10cf5427d
7
+ data.tar.gz: 8b9be9fd97085adb7735fd9b36bd23897ab18a99d01d2a9cf3acd52496ec3707992a9d57e481519742bd6c50b63c651d63b00a74ad0dd95df56f20608992874a
data/README.rdoc CHANGED
@@ -1,7 +1,7 @@
1
1
  = EnjuSearchLog
2
- {<img src="https://travis-ci.org/next-l/enju_search_log.svg?branch=1.1" alt="Build Status" />}[https://travis-ci.org/next-l/enju_search_log]
3
- {<img src="https://coveralls.io/repos/next-l/enju_search_log/badge.svg?branch=1.1&service=github" alt="Coverage Status" />}[https://coveralls.io/github/next-l/enju_search_log?branch=1.1]
4
- {<img src="https://hakiri.io/github/next-l/enju_search_log/1.1.svg" alt="security" />}[https://hakiri.io/github/next-l/enju_search_log/1.1]
2
+ {<img src="https://travis-ci.org/next-l/enju_search_log.svg?branch=1.2" alt="Build Status" />}[https://travis-ci.org/next-l/enju_search_log]
3
+ {<img src="https://coveralls.io/repos/next-l/enju_search_log/badge.svg?branch=1.2&service=github" alt="Coverage Status" />}[https://coveralls.io/github/next-l/enju_search_log?branch=1.2]
4
+ {<img src="https://hakiri.io/github/next-l/enju_search_log/1.2.svg" alt="security" />}[https://hakiri.io/github/next-l/enju_search_log/1.2]
5
5
 
6
6
  This project rocks and uses MIT-LICENSE.
7
7
 
@@ -1,6 +1,6 @@
1
1
  class SearchHistoriesController < ApplicationController
2
- # index, show以外は外部からは呼び出されないはず
3
- load_and_authorize_resource
2
+ before_action :set_search_history, only: [:show, :edit, :update, :destroy]
3
+ before_action :check_policy, only: [:index, :new, :create]
4
4
 
5
5
  # GET /search_histories
6
6
  # GET /search_histories.json
@@ -55,6 +55,15 @@ class SearchHistoriesController < ApplicationController
55
55
  end
56
56
 
57
57
  private
58
+ def set_search_history
59
+ @search_history = SearchHistory.find(params[:id])
60
+ authorize @search_history
61
+ end
62
+
63
+ def check_policy
64
+ authorize SearchHistory
65
+ end
66
+
58
67
  def search_history_params
59
68
  params.require(:search_history).require(
60
69
  :user_id, :operation, :sru_version, :query, :maximum_records,
@@ -0,0 +1,32 @@
1
+ class SearchHistoryPolicy < ApplicationPolicy
2
+ def index?
3
+ true if user.try(:has_role?, 'User')
4
+ end
5
+
6
+ def show?
7
+ case user.try(:role).try(:name)
8
+ when 'Administrator'
9
+ true
10
+ when 'Librarian'
11
+ true if record.user == user
12
+ when 'User'
13
+ true if record.user == user
14
+ end
15
+ end
16
+
17
+ def create?
18
+ false
19
+ end
20
+
21
+ def update?
22
+ false
23
+ end
24
+
25
+ def destroy?
26
+ show?
27
+ end
28
+
29
+ def remove_all?
30
+ true if user.try(:has_role?, 'User')
31
+ end
32
+ end
@@ -35,12 +35,12 @@
35
35
  <%- end -%>
36
36
  <td><%= l(search_history.created_at) -%></td>
37
37
  <td>
38
- <%- if can? :delete, search_history -%>
38
+ <%- if policy(search_history).show? -%>
39
39
  <%= link_to t('page.show'), search_history -%>
40
40
  <% end %>
41
41
  </td>
42
42
  <td>
43
- <%- if can? :delete, search_history -%>
43
+ <%- if policy(search_history).destroy? -%>
44
44
  <%= link_to t('page.destroy'), search_history, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
45
45
  <%- end -%>
46
46
  </td>
@@ -1,3 +1,3 @@
1
1
  module EnjuSearchLog
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0.beta.1"
3
3
  end
@@ -51,13 +51,13 @@ describe SearchHistoriesController do
51
51
  describe "When not logged in" do
52
52
  it "assigns all search_histories as @search_histories" do
53
53
  get :index
54
- assigns(:search_histories).should be_empty
54
+ assigns(:search_histories).should be_nil
55
55
  response.should redirect_to new_user_session_url
56
56
  end
57
57
 
58
58
  it "should not get other's search_histories" do
59
59
  get :index, :user_id => users(:admin).username
60
- assigns(:search_histories).should be_empty
60
+ assigns(:search_histories).should be_nil
61
61
  response.should redirect_to new_user_session_url
62
62
  end
63
63
  end
@@ -1,6 +1,9 @@
1
1
  class ApplicationController < ActionController::Base
2
2
  protect_from_forgery
3
+ include EnjuLeaf::Controller
4
+ include EnjuBiblio::Controller
5
+ include EnjuLibrary::Controller
6
+ after_action :verify_authorized
3
7
 
4
- enju_leaf
5
- enju_library
8
+ include Pundit
6
9
  end
@@ -4,6 +4,6 @@ class User < ActiveRecord::Base
4
4
  :recoverable, :rememberable, :trackable, #, :validatable
5
5
  :lockable, :lock_strategy => :none, :unlock_strategy => :none
6
6
 
7
- enju_leaf_user_model
7
+ include EnjuLeaf::EnjuUser
8
8
  enju_search_log_user_model
9
9
  end
@@ -2,8 +2,9 @@ require File.expand_path('../boot', __FILE__)
2
2
 
3
3
  require 'rails/all'
4
4
 
5
- Bundler.require
6
- require "enju_search_log"
5
+ Bundler.require(*Rails.groups)
6
+ require 'enju_search_log'
7
+ require 'enju_leaf'
7
8
 
8
9
  module Dummy
9
10
  class Application < Rails::Application
@@ -11,16 +12,6 @@ module Dummy
11
12
  # Application configuration should go into files in config/initializers
12
13
  # -- all .rb files in that directory are automatically loaded.
13
14
 
14
- # Custom directories with classes and modules you want to be autoloadable.
15
- # config.autoload_paths += %W(#{config.root}/extras)
16
-
17
- # Only load the plugins named here, in the order given (default is alphabetical).
18
- # :all can be used as a placeholder for all plugins not explicitly named.
19
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
20
-
21
- # Activate observers that should always be running.
22
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
23
-
24
15
  # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
25
16
  # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
26
17
  # config.time_zone = 'Central Time (US & Canada)'
@@ -29,18 +20,8 @@ module Dummy
29
20
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30
21
  # config.i18n.default_locale = :de
31
22
 
32
- # Configure the default encoding used in templates for Ruby 1.9.
33
- config.encoding = "utf-8"
34
-
35
- # Configure sensitive parameters which will be filtered from the log file.
36
- config.filter_parameters += [:password]
37
-
38
- # Enable the asset pipeline
39
- config.assets.enabled = true
40
-
41
- # Version of your assets, change this if you want to expire all your assets
42
- config.assets.version = '1.0'
23
+ # Do not swallow errors in after_commit/after_rollback callbacks.
24
+ config.active_record.raise_in_transactional_callbacks = true
43
25
  end
44
26
  end
45
27
 
46
- require 'enju_leaf'
@@ -1,30 +1,41 @@
1
- Dummy::Application.configure do
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. This slows down response time but is perfect for development
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
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
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
- # Only use best-standards-support built into browsers
23
- config.action_dispatch.best_standards_support = :builtin
22
+ # Raise an error on page load if there are pending migrations.
23
+ config.active_record.migration_error = :page_load
24
24
 
25
- # Do not compress assets
26
- config.assets.compress = false
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
- Dummy::Application.configure do
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
- # Full error reports are disabled and caching is turned on
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
- # Disable Rails's static asset server (Apache or nginx will already do this)
12
- config.serve_static_assets = false
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.compress = true
27
+ # Compress JavaScripts and CSS.
28
+ config.assets.js_compressor = :uglifier
29
+ # config.assets.css_compressor = :sass
16
30
 
17
- # Don't fallback to assets pipeline if a precompiled asset is missed
31
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
18
32
  config.assets.compile = false
19
33
 
20
- # Generate digests for assets URLs
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
- # Defaults to Rails.root.join("public/assets")
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 = "X-Sendfile" # for apache
28
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
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
- # See everything in the log (default is :info)
34
- # config.log_level = :debug
47
+ # Use the lowest log level to ensure availability of diagnostic information
48
+ # when problems arise.
49
+ config.log_level = :debug
35
50
 
36
- # Use a different logger for distributed setups
37
- # config.logger = SyslogLogger.new
51
+ # Prepend all log lines with the following tags.
52
+ # config.log_tags = [ :subdomain, :uuid ]
38
53
 
39
- # Use a different cache store in production
40
- # config.cache_store = :mem_cache_store
54
+ # Use a different logger for distributed setups.
55
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
56
 
42
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
43
- # config.action_controller.asset_host = "http://assets.example.com"
57
+ # Use a different cache store in production.
58
+ # config.cache_store = :mem_cache_store
44
59
 
45
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
46
- # config.assets.precompile += %w( search.js )
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
- # Disable delivery errors, bad email addresses will be ignored
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 can not be found)
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
- Dummy::Application.configure do
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. You never need to work with it otherwise. Remember that
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. Don't rely on the data there!
7
+ # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
10
- # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_assets = true
12
- config.static_cache_control = "public, max-age=3600"
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
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
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 = false
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
- # Use SQL instead of Active Record's schema dumper when creating the test database.
33
- # This is necessary if your schema can't be completely dumped by the schema dumper,
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
@@ -13,7 +13,7 @@
13
13
 
14
14
  ActiveRecord::Schema.define(version: 20150221063719) do
15
15
 
16
- create_table "accepts", force: true do |t|
16
+ create_table "accepts", force: :cascade do |t|
17
17
  t.integer "basket_id"
18
18
  t.integer "item_id"
19
19
  t.integer "librarian_id"
@@ -24,7 +24,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
24
24
  add_index "accepts", ["basket_id"], name: "index_accepts_on_basket_id"
25
25
  add_index "accepts", ["item_id"], name: "index_accepts_on_item_id"
26
26
 
27
- create_table "baskets", force: true do |t|
27
+ create_table "baskets", force: :cascade do |t|
28
28
  t.integer "user_id"
29
29
  t.text "note"
30
30
  t.integer "lock_version", default: 0, null: false
@@ -34,7 +34,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
34
34
 
35
35
  add_index "baskets", ["user_id"], name: "index_baskets_on_user_id"
36
36
 
37
- create_table "bookstores", force: true do |t|
37
+ create_table "bookstores", force: :cascade do |t|
38
38
  t.text "name", null: false
39
39
  t.string "zip_code"
40
40
  t.text "address"
@@ -48,7 +48,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
48
48
  t.datetime "updated_at"
49
49
  end
50
50
 
51
- create_table "budget_types", force: true do |t|
51
+ create_table "budget_types", force: :cascade do |t|
52
52
  t.string "name"
53
53
  t.text "display_name"
54
54
  t.text "note"
@@ -57,7 +57,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
57
57
  t.datetime "updated_at"
58
58
  end
59
59
 
60
- create_table "colors", force: true do |t|
60
+ create_table "colors", force: :cascade do |t|
61
61
  t.integer "library_group_id"
62
62
  t.string "property"
63
63
  t.string "code"
@@ -68,7 +68,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
68
68
 
69
69
  add_index "colors", ["library_group_id"], name: "index_colors_on_library_group_id"
70
70
 
71
- create_table "libraries", force: true do |t|
71
+ create_table "libraries", force: :cascade do |t|
72
72
  t.string "name", null: false
73
73
  t.text "display_name"
74
74
  t.string "short_display_name", null: false
@@ -98,7 +98,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
98
98
  add_index "libraries", ["library_group_id"], name: "index_libraries_on_library_group_id"
99
99
  add_index "libraries", ["name"], name: "index_libraries_on_name", unique: true
100
100
 
101
- create_table "library_groups", force: true do |t|
101
+ create_table "library_groups", force: :cascade do |t|
102
102
  t.string "name", null: false
103
103
  t.text "display_name"
104
104
  t.string "short_name", null: false
@@ -116,7 +116,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
116
116
 
117
117
  add_index "library_groups", ["short_name"], name: "index_library_groups_on_short_name"
118
118
 
119
- create_table "profiles", force: true do |t|
119
+ create_table "profiles", force: :cascade do |t|
120
120
  t.integer "user_id"
121
121
  t.integer "user_group_id"
122
122
  t.integer "library_id"
@@ -137,7 +137,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
137
137
  add_index "profiles", ["user_id"], name: "index_profiles_on_user_id"
138
138
  add_index "profiles", ["user_number"], name: "index_profiles_on_user_number", unique: true
139
139
 
140
- create_table "request_status_types", force: true do |t|
140
+ create_table "request_status_types", force: :cascade do |t|
141
141
  t.string "name", null: false
142
142
  t.text "display_name"
143
143
  t.text "note"
@@ -146,7 +146,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
146
146
  t.datetime "updated_at"
147
147
  end
148
148
 
149
- create_table "request_types", force: true do |t|
149
+ create_table "request_types", force: :cascade do |t|
150
150
  t.string "name", null: false
151
151
  t.text "display_name"
152
152
  t.text "note"
@@ -155,7 +155,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
155
155
  t.datetime "updated_at"
156
156
  end
157
157
 
158
- create_table "roles", force: true do |t|
158
+ create_table "roles", force: :cascade do |t|
159
159
  t.string "name", null: false
160
160
  t.string "display_name"
161
161
  t.text "note"
@@ -165,7 +165,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
165
165
  t.integer "position"
166
166
  end
167
167
 
168
- create_table "search_engines", force: true do |t|
168
+ create_table "search_engines", force: :cascade do |t|
169
169
  t.string "name", null: false
170
170
  t.text "display_name"
171
171
  t.string "url", null: false
@@ -179,7 +179,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
179
179
  t.datetime "updated_at"
180
180
  end
181
181
 
182
- create_table "search_histories", force: true do |t|
182
+ create_table "search_histories", force: :cascade do |t|
183
183
  t.integer "user_id"
184
184
  t.string "operation", default: "searchRetrieve"
185
185
  t.float "sru_version", default: 1.2
@@ -205,7 +205,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
205
205
 
206
206
  add_index "search_histories", ["user_id"], name: "index_search_histories_on_user_id"
207
207
 
208
- create_table "shelves", force: true do |t|
208
+ create_table "shelves", force: :cascade do |t|
209
209
  t.string "name", null: false
210
210
  t.text "display_name"
211
211
  t.text "note"
@@ -220,7 +220,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
220
220
 
221
221
  add_index "shelves", ["library_id"], name: "index_shelves_on_library_id"
222
222
 
223
- create_table "subscribes", force: true do |t|
223
+ create_table "subscribes", force: :cascade do |t|
224
224
  t.integer "subscription_id", null: false
225
225
  t.integer "work_id", null: false
226
226
  t.datetime "start_at", null: false
@@ -232,7 +232,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
232
232
  add_index "subscribes", ["subscription_id"], name: "index_subscribes_on_subscription_id"
233
233
  add_index "subscribes", ["work_id"], name: "index_subscribes_on_work_id"
234
234
 
235
- create_table "subscriptions", force: true do |t|
235
+ create_table "subscriptions", force: :cascade do |t|
236
236
  t.text "title", null: false
237
237
  t.text "note"
238
238
  t.integer "user_id"
@@ -246,7 +246,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
246
246
  add_index "subscriptions", ["order_list_id"], name: "index_subscriptions_on_order_list_id"
247
247
  add_index "subscriptions", ["user_id"], name: "index_subscriptions_on_user_id"
248
248
 
249
- create_table "user_export_file_transitions", force: true do |t|
249
+ create_table "user_export_file_transitions", force: :cascade do |t|
250
250
  t.string "to_state"
251
251
  t.text "metadata", default: "{}"
252
252
  t.integer "sort_key"
@@ -258,7 +258,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
258
258
  add_index "user_export_file_transitions", ["sort_key", "user_export_file_id"], name: "index_user_export_file_transitions_on_sort_key_and_file_id", unique: true
259
259
  add_index "user_export_file_transitions", ["user_export_file_id"], name: "index_user_export_file_transitions_on_file_id"
260
260
 
261
- create_table "user_export_files", force: true do |t|
261
+ create_table "user_export_files", force: :cascade do |t|
262
262
  t.integer "user_id"
263
263
  t.string "user_export_file_name"
264
264
  t.string "user_export_content_type"
@@ -269,7 +269,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
269
269
  t.datetime "updated_at"
270
270
  end
271
271
 
272
- create_table "user_groups", force: true do |t|
272
+ create_table "user_groups", force: :cascade do |t|
273
273
  t.string "name"
274
274
  t.text "display_name"
275
275
  t.text "note"
@@ -281,7 +281,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
281
281
  t.datetime "expired_at"
282
282
  end
283
283
 
284
- create_table "user_has_roles", force: true do |t|
284
+ create_table "user_has_roles", force: :cascade do |t|
285
285
  t.integer "user_id"
286
286
  t.integer "role_id"
287
287
  t.datetime "created_at"
@@ -291,7 +291,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
291
291
  add_index "user_has_roles", ["role_id"], name: "index_user_has_roles_on_role_id"
292
292
  add_index "user_has_roles", ["user_id"], name: "index_user_has_roles_on_user_id"
293
293
 
294
- create_table "user_import_file_transitions", force: true do |t|
294
+ create_table "user_import_file_transitions", force: :cascade do |t|
295
295
  t.string "to_state"
296
296
  t.text "metadata", default: "{}"
297
297
  t.integer "sort_key"
@@ -303,7 +303,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
303
303
  add_index "user_import_file_transitions", ["sort_key", "user_import_file_id"], name: "index_user_import_file_transitions_on_sort_key_and_file_id", unique: true
304
304
  add_index "user_import_file_transitions", ["user_import_file_id"], name: "index_user_import_file_transitions_on_user_import_file_id"
305
305
 
306
- create_table "user_import_files", force: true do |t|
306
+ create_table "user_import_files", force: :cascade do |t|
307
307
  t.integer "user_id"
308
308
  t.text "note"
309
309
  t.datetime "executed_at"
@@ -321,7 +321,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
321
321
  t.integer "default_user_group_id"
322
322
  end
323
323
 
324
- create_table "user_import_results", force: true do |t|
324
+ create_table "user_import_results", force: :cascade do |t|
325
325
  t.integer "user_import_file_id"
326
326
  t.integer "user_id"
327
327
  t.text "body"
@@ -329,7 +329,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
329
329
  t.datetime "updated_at"
330
330
  end
331
331
 
332
- create_table "users", force: true do |t|
332
+ create_table "users", force: :cascade do |t|
333
333
  t.string "email", default: "", null: false
334
334
  t.string "encrypted_password", default: "", null: false
335
335
  t.string "reset_password_token"
@@ -357,7 +357,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
357
357
  add_index "users", ["unlock_token"], name: "index_users_on_unlock_token", unique: true
358
358
  add_index "users", ["username"], name: "index_users_on_username", unique: true
359
359
 
360
- create_table "versions", force: true do |t|
360
+ create_table "versions", force: :cascade do |t|
361
361
  t.string "item_type", null: false
362
362
  t.integer "item_id", null: false
363
363
  t.string "event", null: false
metadata CHANGED
@@ -1,29 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_search_log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
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: 2015-12-26 00:00:00.000000000 Z
11
+ date: 2016-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: enju_leaf
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.2.0.beta.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.2.0.beta.1
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: enju_biblio
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: 0.1.2
33
+ version: 0.2.0.beta.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.2.0.beta.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: enju_library
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.2.0.beta.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.2.0.beta.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: enju_manifestation_viewer
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.2.0.beta.1
20
62
  type: :runtime
21
63
  prerelease: false
22
64
  version_requirements: !ruby/object:Gem::Requirement
23
65
  requirements:
24
66
  - - "~>"
25
67
  - !ruby/object:Gem::Version
26
- version: 0.1.2
68
+ version: 0.2.0.beta.1
27
69
  - !ruby/object:Gem::Dependency
28
70
  name: sqlite3
29
71
  requirement: !ruby/object:Gem::Requirement
@@ -42,16 +84,16 @@ dependencies:
42
84
  name: mysql2
43
85
  requirement: !ruby/object:Gem::Requirement
44
86
  requirements:
45
- - - "~>"
87
+ - - ">="
46
88
  - !ruby/object:Gem::Version
47
- version: 0.3.20
89
+ version: '0'
48
90
  type: :development
49
91
  prerelease: false
50
92
  version_requirements: !ruby/object:Gem::Requirement
51
93
  requirements:
52
- - - "~>"
94
+ - - ">="
53
95
  - !ruby/object:Gem::Version
54
- version: 0.3.20
96
+ version: '0'
55
97
  - !ruby/object:Gem::Dependency
56
98
  name: pg
57
99
  requirement: !ruby/object:Gem::Requirement
@@ -94,20 +136,6 @@ dependencies:
94
136
  - - ">="
95
137
  - !ruby/object:Gem::Version
96
138
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: enju_leaf
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 1.1.2
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 1.1.2
111
139
  - !ruby/object:Gem::Dependency
112
140
  name: annotate
113
141
  requirement: !ruby/object:Gem::Requirement
@@ -151,7 +179,7 @@ dependencies:
151
179
  - !ruby/object:Gem::Version
152
180
  version: '0'
153
181
  - !ruby/object:Gem::Dependency
154
- name: appraisal
182
+ name: coveralls
155
183
  requirement: !ruby/object:Gem::Requirement
156
184
  requirements:
157
185
  - - ">="
@@ -176,8 +204,8 @@ files:
176
204
  - Rakefile
177
205
  - app/controllers/search_histories_controller.rb
178
206
  - app/helpers/search_histories_helper.rb
179
- - app/models/enju_search_log/ability.rb
180
207
  - app/models/search_history.rb
208
+ - app/policies/search_history_policy.rb
181
209
  - app/views/search_histories/edit.html.erb
182
210
  - app/views/search_histories/index.html.erb
183
211
  - app/views/search_histories/new.html.erb
@@ -212,7 +240,6 @@ files:
212
240
  - spec/dummy/bin/setup
213
241
  - spec/dummy/config.ru
214
242
  - spec/dummy/config/application.rb
215
- - spec/dummy/config/application.yml
216
243
  - spec/dummy/config/boot.rb
217
244
  - spec/dummy/config/database.yml
218
245
  - spec/dummy/config/environment.rb
@@ -297,12 +324,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
297
324
  version: '0'
298
325
  required_rubygems_version: !ruby/object:Gem::Requirement
299
326
  requirements:
300
- - - ">="
327
+ - - ">"
301
328
  - !ruby/object:Gem::Version
302
- version: '0'
329
+ version: 1.3.1
303
330
  requirements: []
304
331
  rubyforge_project:
305
- rubygems_version: 2.5.0
332
+ rubygems_version: 2.5.1
306
333
  signing_key:
307
334
  specification_version: 4
308
335
  summary: enju_search_log plugin
@@ -320,7 +347,6 @@ test_files:
320
347
  - spec/dummy/bin/rake
321
348
  - spec/dummy/bin/setup
322
349
  - spec/dummy/config/application.rb
323
- - spec/dummy/config/application.yml
324
350
  - spec/dummy/config/boot.rb
325
351
  - spec/dummy/config/database.yml
326
352
  - spec/dummy/config/environment.rb
@@ -1,22 +0,0 @@
1
- module EnjuSearchLog
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, SearchHistory
9
- when 'Librarian'
10
- can :index, SearchHistory
11
- can [:show, :destroy, :delete], SearchHistory do |search_history|
12
- search_history.user == user
13
- end
14
- when 'User'
15
- can :index, SearchHistory
16
- can [:show, :destroy, :delete], SearchHistory do |search_history|
17
- search_history.user == user
18
- end
19
- end
20
- end
21
- end
22
- end
@@ -1,38 +0,0 @@
1
- defaults: &defaults
2
- enju:
3
- web_hostname: localhost
4
- web_port_number: 3000
5
-
6
- family_name_first: true
7
- max_number_of_results: 500
8
- write_search_log_to_file: true
9
- csv_charset_conversion: true
10
-
11
- # Choose a locale from 'ca', 'de', 'fr', 'jp', 'uk', 'us'
12
- #AMAZON_AWS_HOSTNAME = 'ecs.amazonaws.com'
13
- amazon:
14
- aws_hostname: ecs.amazonaws.jp
15
- hostname: www.amazon.co.jp
16
- access_key: REPLACE_WITH_YOUR_AMAZON_ACCESS_KEY
17
- secret_access_key: REPLACE_WITH_YOUR_AMAZON_SECRET_ACCESS_KEY
18
-
19
- # :google, :amazon
20
- book_jacket:
21
- source: :google
22
- unknown_resource:
23
-
24
- # :mozshot, :simpleapi, :heartrails, :thumbalizr
25
- screenshot:
26
- generator: :mozshot
27
-
28
- uploaded_file:
29
- storage: :local
30
-
31
- development:
32
- <<: *defaults
33
-
34
- test:
35
- <<: *defaults
36
-
37
- production:
38
- <<: *defaults