Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,14 @@ GEM
multipart-post (~> 2.0)
faraday-net_http (3.4.1)
net-http (>= 0.5.0)
ffi (1.17.2-aarch64-linux-gnu)
ffi (1.17.2-aarch64-linux-musl)
ffi (1.17.2-arm-linux-gnu)
ffi (1.17.2-arm-linux-musl)
ffi (1.17.2-arm64-darwin)
ffi (1.17.2-x86_64-darwin)
ffi (1.17.2-x86_64-linux-gnu)
ffi (1.17.2-x86_64-linux-musl)
friendly_id (5.5.1)
activerecord (>= 4.0.0)
fugit (1.11.1)
Expand Down Expand Up @@ -286,8 +293,22 @@ GEM
net-protocol
nio4r (2.7.4)
nkf (0.2.0)
nokogiri (1.18.9-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.9-aarch64-linux-musl)
racc (~> 1.4)
nokogiri (1.18.9-arm-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.9-arm-linux-musl)
racc (~> 1.4)
nokogiri (1.18.9-arm64-darwin)
racc (~> 1.4)
nokogiri (1.18.9-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.18.9-x86_64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.9-x86_64-linux-musl)
racc (~> 1.4)
nori (2.7.1)
bigdecimal
oai (1.3.0)
Expand Down Expand Up @@ -577,7 +598,14 @@ GEM
zeitwerk (2.7.3)

PLATFORMS
x86_64-linux
aarch64-linux-gnu
aarch64-linux-musl
arm-linux-gnu
arm-linux-musl
arm64-darwin
x86_64-darwin
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
active_storage_validations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def user_group_has_checkout_type_params
:user_group_id, :checkout_type_id,
:checkout_limit, :checkout_period, :checkout_renewal_limit,
:reservation_limit, :reservation_expired_period,
:set_due_date_before_closing_day, :fixed_due_date, :note, :position,
:due_date_offset, :fixed_due_date, :note, :position,
:user_group, :checkout_type
)
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/user_groups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def user_group_params
# EnjuCirculation
{ user_group_has_checkout_types_attributes: [
:id, :checkout_type_id, :checkout_limit, :checkout_period, :checkout_renewal_limit,
:reservation_limit, :reservation_expired_period, :set_due_date_before_closing_day
:reservation_limit, :reservation_expired_period, :due_date_offset
] }
)
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/agent_import_result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class AgentImportResult < ApplicationRecord
# Table name: agent_import_results
#
# id :bigint not null, primary key
# agent_import_file_id :bigint
# agent_id :bigint
# body :text
# created_at :datetime not null
# updated_at :datetime not null
# agent_id :bigint
# agent_import_file_id :bigint
#
6 changes: 3 additions & 3 deletions app/models/bookmark_stat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def self.initial_state
# Table name: bookmark_stats
#
# id :bigint not null, primary key
# start_date :datetime
# end_date :datetime
# started_at :datetime
# completed_at :datetime
# end_date :datetime
# note :text
# start_date :datetime
# started_at :datetime
# created_at :datetime not null
# updated_at :datetime not null
#
8 changes: 4 additions & 4 deletions app/models/bookstore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class Bookstore < ApplicationRecord
# Table name: bookstores
#
# id :bigint not null, primary key
# name :text not null
# zip_code :string
# address :text
# fax_number :string
# name :text not null
# note :text
# position :integer
# telephone_number :string
# fax_number :string
# url :string
# position :integer
# zip_code :string
# created_at :datetime not null
# updated_at :datetime not null
#
7 changes: 2 additions & 5 deletions app/models/checked_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,12 @@ def set_due_date
return nil unless item_checkout_type

if due_date_string.present?
# 返却期限日を明示的に指定した場合
date = Time.zone.parse(due_date_string).try(:end_of_day)
else
# 返却期限日が閉館日の場合
if item.shelf.library.closed?(item_checkout_type.checkout_period.days.from_now)
if item_checkout_type.set_due_date_before_closing_day
date = (item_checkout_type.checkout_period - 1).days.from_now.end_of_day
else
date = (item_checkout_type.checkout_period + 1).days.from_now.end_of_day
end
date = (item_checkout_type.checkout_period + item_checkout_type.due_date_offset + 1).days.from_now.end_of_day
else
date = (item_checkout_type.checkout_period + 1).days.from_now.end_of_day
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/event_category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class EventCategory < ApplicationRecord
# Table name: event_categories
#
# id :bigint not null, primary key
# name :string not null
# display_name :text
# name :string not null
# note :text
# position :integer
# created_at :datetime not null
Expand Down
4 changes: 2 additions & 2 deletions app/models/event_import_result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def self.header
# Table name: event_import_results
#
# id :bigint not null, primary key
# event_import_file_id :bigint
# event_id :bigint
# body :text
# created_at :datetime not null
# updated_at :datetime not null
# event_id :bigint
# event_import_file_id :bigint
#
6 changes: 3 additions & 3 deletions app/models/news_feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def self.fetch_feeds
# Table name: news_feeds
#
# id :bigint not null, primary key
# library_group_id :bigint default(1), not null
# title :string
# url :string
# body :text
# position :integer
# title :string
# url :string
# created_at :datetime not null
# updated_at :datetime not null
# library_group_id :bigint default(1), not null
#
10 changes: 5 additions & 5 deletions app/models/search_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ def search_params(query)
# Table name: search_engines
#
# id :bigint not null, primary key
# name :string not null
# display_name :text
# url :string not null
# additional_param :text
# base_url :text not null
# display_name :text
# http_method :text not null
# query_param :text not null
# additional_param :text
# name :string not null
# note :text
# position :integer
# query_param :text not null
# url :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
1 change: 1 addition & 0 deletions app/models/user_group_has_checkout_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def self.update_current_checkout_count
# checkout_period :integer default(0), not null
# checkout_renewal_limit :integer default(0), not null
# current_checkout_count :integer
# due_date_offset :integer default(1), not null
# fixed_due_date :datetime
# note :text
# position :integer
Expand Down
4 changes: 2 additions & 2 deletions app/views/user_group_has_checkout_types/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
</div>

<div class="field">
<%= f.label :set_due_date_before_closing_day -%>
<%= f.check_box :set_due_date_before_closing_day -%>
<%= f.label :due_date_offset -%>
<%= f.check_box :due_date_offset -%>
</div>

<div class="field">
Expand Down
4 changes: 2 additions & 2 deletions app/views/user_group_has_checkout_types/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
</p>

<p>
<strong><%= t('activerecord.attributes.user_group_has_checkout_type.set_due_date_before_closing_day') -%>:</strong>
<%= localized_boolean(@user_group_has_checkout_type.set_due_date_before_closing_day) -%>
<strong><%= t('activerecord.attributes.user_group_has_checkout_type.due_date_offset') -%>:</strong>
<%= @user_group_has_checkout_type.due_date_offset -%>
</p>

<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<br />
<%= f.label :reservation_limit -%>
<%= f.text_field :reservation_limit, class: 'resource_integer' %>
<%= f.label :set_due_date_before_closing_day -%>
<%= f.check_box :set_due_date_before_closing_day %>
<%= f.label :due_date_offset -%>
<%= f.check_box :due_date_offset %>
<%= link_to_remove_association t('page.remove'), f, data: {confirm: t('page.are_you_sure')} %>
</div>
2 changes: 1 addition & 1 deletion config/locales/enju_circulation_en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ en:
checkout_renewal_limit: Checkout renewal limit
reservation_limit: Reservation limit
reservation_expired_period: Reservation expired period
set_due_date_before_closing_day: Set due date before the closing day
due_date_offset: Due date offset for closing day
fixed_due_date: Fixed due date
note: Note
position: Position
Expand Down
2 changes: 1 addition & 1 deletion config/locales/enju_circulation_ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ja:
checkout_renewal_limit: 貸出更新回数の上限
reservation_limit: 予約数の上限
reservation_expired_period: 予約の期限切れまでの期間
set_due_date_before_closing_day: 返却日を閉館日の前日にする
due_date_offset: 返却期限日が閉館日の場合の設定
fixed_due_date: 固定貸出期限
note: 注記
position: 位置
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddDueDateOffsetToUserGroupHasCheckoutTypes < ActiveRecord::Migration[6.1]
def change
add_column :user_group_has_checkout_types, :due_date_offset, :integer, default: 1, null: false
end
end
1 change: 1 addition & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1712,6 +1712,7 @@
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "current_checkout_count"
t.integer "due_date_offset", default: 1, null: false
t.index ["checkout_type_id"], name: "index_user_group_has_checkout_types_on_checkout_type_id"
t.index ["user_group_id", "checkout_type_id"], name: "index_user_group_has_checkout_types_on_user_group_id", unique: true
end
Expand Down
6 changes: 3 additions & 3 deletions spec/factories/bookmark_stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
# Table name: bookmark_stats
#
# id :bigint not null, primary key
# start_date :datetime
# end_date :datetime
# started_at :datetime
# completed_at :datetime
# end_date :datetime
# note :text
# start_date :datetime
# started_at :datetime
# created_at :datetime not null
# updated_at :datetime not null
#
8 changes: 4 additions & 4 deletions spec/factories/bookstores.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
# Table name: bookstores
#
# id :bigint not null, primary key
# name :text not null
# zip_code :string
# address :text
# fax_number :string
# name :text not null
# note :text
# position :integer
# telephone_number :string
# fax_number :string
# url :string
# position :integer
# zip_code :string
# created_at :datetime not null
# updated_at :datetime not null
#
2 changes: 1 addition & 1 deletion spec/factories/event_categories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# Table name: event_categories
#
# id :bigint not null, primary key
# name :string not null
# display_name :text
# name :string not null
# note :text
# position :integer
# created_at :datetime not null
Expand Down
6 changes: 3 additions & 3 deletions spec/factories/news_feeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
# Table name: news_feeds
#
# id :bigint not null, primary key
# library_group_id :bigint default(1), not null
# title :string
# url :string
# body :text
# position :integer
# title :string
# url :string
# created_at :datetime not null
# updated_at :datetime not null
# library_group_id :bigint default(1), not null
#
10 changes: 5 additions & 5 deletions spec/factories/search_engines.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
# Table name: search_engines
#
# id :bigint not null, primary key
# name :string not null
# display_name :text
# url :string not null
# additional_param :text
# base_url :text not null
# display_name :text
# http_method :text not null
# query_param :text not null
# additional_param :text
# name :string not null
# note :text
# position :integer
# query_param :text not null
# url :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
15 changes: 8 additions & 7 deletions spec/factories/user_group_has_checkout_types.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
FactoryBot.define do
factory :user_group_has_checkout_type do |f|
f.user_group_id {FactoryBot.create(:user_group).id}
f.checkout_type_id {FactoryBot.create(:checkout_type).id}
end
end

# == Schema Information
#
# Table name: user_group_has_checkout_types
Expand All @@ -14,6 +7,7 @@
# checkout_period :integer default(0), not null
# checkout_renewal_limit :integer default(0), not null
# current_checkout_count :integer
# due_date_offset :integer default(1), not null
# fixed_due_date :datetime
# note :text
# position :integer
Expand All @@ -35,3 +29,10 @@
# fk_rails_... (checkout_type_id => checkout_types.id)
# fk_rails_... (user_group_id => user_groups.id)
#
FactoryBot.define do
factory :user_group_has_checkout_type do |f|
f.user_group_id {FactoryBot.create(:user_group).id}
f.checkout_type_id {FactoryBot.create(:checkout_type).id}
end
end

4 changes: 2 additions & 2 deletions spec/fixtures/agent_import_results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ two:
# Table name: agent_import_results
#
# id :bigint not null, primary key
# agent_import_file_id :bigint
# agent_id :bigint
# body :text
# created_at :datetime not null
# updated_at :datetime not null
# agent_id :bigint
# agent_import_file_id :bigint
#
Loading
Loading