enju_circulation 0.1.0.pre27 → 0.1.0.pre28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/lending_policies_controller.rb +1 -1
- data/app/models/checkin.rb +2 -1
- data/app/models/checkout.rb +13 -3
- data/app/models/lending_policy.rb +1 -1
- data/app/models/reserve.rb +3 -0
- data/app/views/checked_items/edit.html.erb +1 -0
- data/db/migrate/20090831220301_create_lending_policies.rb +1 -1
- data/db/migrate/20130519065638_add_lock_version_to_reserve.rb +5 -0
- data/db/migrate/20130519065837_add_lock_version_to_checkin.rb +5 -0
- data/lib/enju_circulation/version.rb +1 -1
- data/spec/controllers/checkins_controller_spec.rb +7 -20
- data/spec/controllers/checkouts_controller_spec.rb +0 -15
- data/spec/controllers/reserves_controller_spec.rb +0 -20
- data/spec/dummy/app/controllers/application_controller.rb +1 -114
- data/spec/dummy/config/application.rb +2 -3
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +13 -11
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/solr/data/test/index/{_22w.fdt → _2fp.fdt} +0 -0
- data/spec/dummy/solr/data/test/index/{_22w.fdx → _2fp.fdx} +0 -0
- data/spec/dummy/solr/data/test/index/{_22w.fnm → _2fp.fnm} +0 -0
- data/spec/dummy/solr/data/test/index/{_22w.frq → _2fp.frq} +0 -0
- data/spec/dummy/solr/data/test/index/{_22w.nrm → _2fp.nrm} +0 -0
- data/spec/dummy/solr/data/test/index/{_22w.prx → _2fp.prx} +0 -0
- data/spec/dummy/solr/data/test/index/{_22w.tii → _2fp.tii} +0 -0
- data/spec/dummy/solr/data/test/index/{_22w.tis → _2fp.tis} +0 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/{segments_45l → segments_4v7} +0 -0
- data/spec/fixtures/checkins.yml +6 -0
- data/spec/fixtures/circulation_statuses.yml +14 -0
- data/spec/fixtures/lending_policies.yml +1 -1
- data/spec/fixtures/reserves.yml +18 -1
- data/spec/models/checkin_spec.rb +1 -0
- data/spec/models/lending_policy_spec.rb +1 -1
- data/spec/models/reserve_spec.rb +3 -0
- metadata +38 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7614545d4d02474d17463e6ad8ec31b633fa70b0
|
4
|
+
data.tar.gz: bf94c2558f49d871971c52efd33811146cc3c9f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5654c425686b7f03368d987259de994cb145745f7037947faf02149acda54562cb34f84da81e73ff0ca45f39b84ae73962c4c4b28ed14f2d0cd874bc13f69881
|
7
|
+
data.tar.gz: cdb45767a7c3a473cae38ff73b41068ac0cf80525f7b8cefc796ff538c3fd2b7b26a9b4fca99ce56999b622ea95da3e8b6984d948125a7c5ef20067b1a0a6e51
|
@@ -4,7 +4,7 @@ class LendingPoliciesController < InheritedResources::Base
|
|
4
4
|
before_filter :prepare_options, :only => [:edit, :update]
|
5
5
|
|
6
6
|
def index
|
7
|
-
@lending_policies =
|
7
|
+
@lending_policies = LendingPolicy.page(params[:page])
|
8
8
|
end
|
9
9
|
|
10
10
|
private
|
data/app/models/checkin.rb
CHANGED
@@ -45,7 +45,7 @@ class Checkin < ActiveRecord::Base
|
|
45
45
|
unless checkout.user.try(:save_checkout_history)
|
46
46
|
checkout.user = nil
|
47
47
|
end
|
48
|
-
checkout.save
|
48
|
+
checkout.save(:validate => false)
|
49
49
|
unless checkout.item.shelf.library == current_user.library
|
50
50
|
message << I18n.t('checkin.other_library_item')
|
51
51
|
end
|
@@ -95,5 +95,6 @@ end
|
|
95
95
|
# basket_id :integer
|
96
96
|
# created_at :datetime not null
|
97
97
|
# updated_at :datetime not null
|
98
|
+
# lock_version :integer default(0), not null
|
98
99
|
#
|
99
100
|
|
data/app/models/checkout.rb
CHANGED
@@ -56,14 +56,24 @@ class Checkout < ActiveRecord::Base
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def renewable?
|
59
|
+
return nil if checkin
|
60
|
+
messages = []
|
59
61
|
if !operator and overdue?
|
60
|
-
|
62
|
+
messages << I18n.t('checkout.you_have_overdue_item')
|
61
63
|
end
|
62
64
|
if !operator and reserved?
|
63
|
-
|
65
|
+
messages << I18n.t('checkout.this_item_is_reserved')
|
64
66
|
end
|
65
67
|
if !operator and over_checkout_renewal_limit?
|
66
|
-
|
68
|
+
messages << I18n.t('checkout.excessed_renewal_limit')
|
69
|
+
end
|
70
|
+
if messages.empty?
|
71
|
+
true
|
72
|
+
else
|
73
|
+
messages.each do |message|
|
74
|
+
errors[:base] << message
|
75
|
+
end
|
76
|
+
false
|
67
77
|
end
|
68
78
|
end
|
69
79
|
|
@@ -24,7 +24,7 @@ end
|
|
24
24
|
# loan_period :integer default(0), not null
|
25
25
|
# fixed_due_date :datetime
|
26
26
|
# renewal :integer default(0), not null
|
27
|
-
# fine :
|
27
|
+
# fine :integer default(0), not null
|
28
28
|
# note :text
|
29
29
|
# position :integer
|
30
30
|
# created_at :datetime not null
|
data/app/models/reserve.rb
CHANGED
@@ -441,5 +441,8 @@ end
|
|
441
441
|
# state :string(255)
|
442
442
|
# expiration_notice_to_patron :boolean default(FALSE)
|
443
443
|
# expiration_notice_to_library :boolean default(FALSE)
|
444
|
+
# retained_at :datetime
|
445
|
+
# postponed_at :datetime
|
446
|
+
# lock_version :integer default(0), not null
|
444
447
|
#
|
445
448
|
|
@@ -6,7 +6,7 @@ class CreateLendingPolicies < ActiveRecord::Migration
|
|
6
6
|
t.integer :loan_period, :default => 0, :null => false
|
7
7
|
t.datetime :fixed_due_date
|
8
8
|
t.integer :renewal, :default => 0, :null => false
|
9
|
-
t.
|
9
|
+
t.integer :fine, :default => 0, :null => false
|
10
10
|
t.text :note
|
11
11
|
t.integer :position
|
12
12
|
|
@@ -66,11 +66,6 @@ describe CheckinsController do
|
|
66
66
|
get :show, :id => checkin.id
|
67
67
|
assigns(:checkin).should eq(checkin)
|
68
68
|
end
|
69
|
-
|
70
|
-
it "should not show missing checkin" do
|
71
|
-
get :show, :id => 'missing'
|
72
|
-
response.should be_missing
|
73
|
-
end
|
74
69
|
end
|
75
70
|
|
76
71
|
describe "When logged in as Librarian" do
|
@@ -151,11 +146,6 @@ describe CheckinsController do
|
|
151
146
|
get :edit, :id => checkin.id
|
152
147
|
assigns(:checkin).should eq(checkin)
|
153
148
|
end
|
154
|
-
|
155
|
-
it "should not edit missing checkin" do
|
156
|
-
get :edit, :id => 'missing'
|
157
|
-
response.should be_missing
|
158
|
-
end
|
159
149
|
end
|
160
150
|
|
161
151
|
describe "When logged in as Librarian" do
|
@@ -213,6 +203,13 @@ describe CheckinsController do
|
|
213
203
|
response.should redirect_to(basket_checkins_url(assigns(:checkin).basket))
|
214
204
|
assigns(:checkin).item.circulation_status.name.should eq 'Available On Shelf'
|
215
205
|
end
|
206
|
+
|
207
|
+
it "should checkin the overdue item" do
|
208
|
+
post :create, :checkin => {:item_identifier => '00014'}, :basket_id => 9
|
209
|
+
response.should redirect_to(basket_checkins_url(assigns(:checkin).basket))
|
210
|
+
assigns(:checkin).checkout.should be_valid
|
211
|
+
assigns(:checkin).item.circulation_status.name.should eq 'Available On Shelf'
|
212
|
+
end
|
216
213
|
end
|
217
214
|
end
|
218
215
|
|
@@ -347,11 +344,6 @@ describe CheckinsController do
|
|
347
344
|
response.should redirect_to(@checkin)
|
348
345
|
end
|
349
346
|
end
|
350
|
-
|
351
|
-
it "should not update missing checkin" do
|
352
|
-
put :update, :id => 'missing', :checkin => { }
|
353
|
-
response.should be_missing
|
354
|
-
end
|
355
347
|
end
|
356
348
|
|
357
349
|
describe "When logged in as Librarian" do
|
@@ -442,11 +434,6 @@ describe CheckinsController do
|
|
442
434
|
delete :destroy, :id => @checkin.id
|
443
435
|
response.should redirect_to(checkins_url)
|
444
436
|
end
|
445
|
-
|
446
|
-
it "should not destroy missing checkin" do
|
447
|
-
delete :destroy, :id => 'missing'
|
448
|
-
response.should be_missing
|
449
|
-
end
|
450
437
|
end
|
451
438
|
|
452
439
|
describe "When logged in as Librarian" do
|
@@ -180,11 +180,6 @@ describe CheckoutsController do
|
|
180
180
|
response.should be_forbidden
|
181
181
|
assigns(:checkout).should eq checkouts(:checkout_00001)
|
182
182
|
end
|
183
|
-
|
184
|
-
it "should not show missing checkout" do
|
185
|
-
get :show, :id => 'missing'
|
186
|
-
response.should be_missing
|
187
|
-
end
|
188
183
|
end
|
189
184
|
|
190
185
|
describe "When not logged in" do
|
@@ -273,11 +268,6 @@ describe CheckoutsController do
|
|
273
268
|
end
|
274
269
|
end
|
275
270
|
|
276
|
-
it "should not update missing checkout" do
|
277
|
-
put :update, :id => 'missing', :checkout => { }
|
278
|
-
response.should be_missing
|
279
|
-
end
|
280
|
-
|
281
271
|
it "should remove its own checkout history" do
|
282
272
|
put :remove_all, :user_id => users(:user1).username
|
283
273
|
users(:user1).checkouts.returned.count.should eq 0
|
@@ -444,11 +434,6 @@ describe CheckoutsController do
|
|
444
434
|
delete :destroy, :id => @returned_checkout.id
|
445
435
|
response.should redirect_to(user_checkouts_url(@returned_checkout.user))
|
446
436
|
end
|
447
|
-
|
448
|
-
it "should not destroy missing checkout" do
|
449
|
-
delete :destroy, :id => 'missing'
|
450
|
-
response.should be_missing
|
451
|
-
end
|
452
437
|
end
|
453
438
|
|
454
439
|
describe "When logged in as Librarian" do
|
@@ -146,11 +146,6 @@ describe ReservesController do
|
|
146
146
|
assigns(:reserve).should eq(reserve)
|
147
147
|
end
|
148
148
|
|
149
|
-
it "should not show missing reserve" do
|
150
|
-
get :show, :id => 'missing'
|
151
|
-
response.should be_missing
|
152
|
-
end
|
153
|
-
|
154
149
|
it "should show other user's reservation" do
|
155
150
|
get :show, :id => 3
|
156
151
|
response.should be_success
|
@@ -290,11 +285,6 @@ describe ReservesController do
|
|
290
285
|
assigns(:reserve).should eq(reserve)
|
291
286
|
end
|
292
287
|
|
293
|
-
it "should not edit missing reserve" do
|
294
|
-
get :edit, :id => 'missing'
|
295
|
-
response.should be_missing
|
296
|
-
end
|
297
|
-
|
298
288
|
it "should edit other user's reservation" do
|
299
289
|
get :edit, :id => 3
|
300
290
|
response.should be_success
|
@@ -667,11 +657,6 @@ describe ReservesController do
|
|
667
657
|
response.should redirect_to reserve_url(assigns(:reserve))
|
668
658
|
end
|
669
659
|
|
670
|
-
it "should not update missing reserve" do
|
671
|
-
put :update, :id => 'missing', :reserve => {:user_number => users(:user1).user_number}
|
672
|
-
response.should be_missing
|
673
|
-
end
|
674
|
-
|
675
660
|
it "should update my reservation" do
|
676
661
|
put :update, :id => 3, :reserve => {:user_number => users(:user1).user_number}
|
677
662
|
flash[:notice].should eq I18n.t('controller.successfully_updated', :model => I18n.t('activerecord.models.reserve'))
|
@@ -731,11 +716,6 @@ describe ReservesController do
|
|
731
716
|
delete :destroy, :id => 3
|
732
717
|
response.should redirect_to reserves_url
|
733
718
|
end
|
734
|
-
|
735
|
-
it "should not destroy missing reserve" do
|
736
|
-
delete :destroy, :id => 'missing'
|
737
|
-
response.should be_missing
|
738
|
-
end
|
739
719
|
end
|
740
720
|
|
741
721
|
describe "When logged in as Librarian" do
|
@@ -1,121 +1,8 @@
|
|
1
1
|
class ApplicationController < ActionController::Base
|
2
2
|
protect_from_forgery
|
3
3
|
|
4
|
-
|
5
|
-
rescue_from ActiveRecord::RecordNotFound, :with => :render_404
|
6
|
-
|
7
|
-
before_filter :set_locale
|
8
|
-
|
4
|
+
enju_leaf
|
9
5
|
enju_biblio
|
10
6
|
enju_library
|
11
7
|
enju_circulation
|
12
|
-
|
13
|
-
private
|
14
|
-
def render_403
|
15
|
-
return if performed?
|
16
|
-
if user_signed_in?
|
17
|
-
respond_to do |format|
|
18
|
-
format.html {render :template => 'page/403', :status => 403}
|
19
|
-
format.mobile {render :template => 'page/403', :status => 403}
|
20
|
-
format.xml {render :template => 'page/403', :status => 403}
|
21
|
-
format.json
|
22
|
-
end
|
23
|
-
else
|
24
|
-
respond_to do |format|
|
25
|
-
format.html {redirect_to new_user_session_url}
|
26
|
-
format.mobile {redirect_to new_user_session_url}
|
27
|
-
format.xml {render :template => 'page/403', :status => 403}
|
28
|
-
format.json
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def render_404
|
34
|
-
return if performed?
|
35
|
-
respond_to do |format|
|
36
|
-
format.html {render :template => 'page/404', :status => 404}
|
37
|
-
format.mobile {render :template => 'page/404', :status => 404}
|
38
|
-
format.xml {render :template => 'page/404', :status => 404}
|
39
|
-
format.json
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def access_denied
|
44
|
-
raise CanCan::AccessDenied
|
45
|
-
end
|
46
|
-
|
47
|
-
def get_user
|
48
|
-
@user = User.where(:username => params[:user_id]).first if params[:user_id]
|
49
|
-
end
|
50
|
-
|
51
|
-
def get_manifestation
|
52
|
-
@manifestation = Manifestation.find(params[:manifestation_id]) if params[:manifestation_id]
|
53
|
-
authorize! :show, @manifestation if @manifestation
|
54
|
-
end
|
55
|
-
|
56
|
-
def get_user_group
|
57
|
-
@user_group = UserGroup.find(params[:user_group_id]) if params[:user_group_id]
|
58
|
-
end
|
59
|
-
|
60
|
-
def set_locale
|
61
|
-
if params[:locale]
|
62
|
-
unless I18n.available_locales.include?(params[:locale].to_s.intern)
|
63
|
-
raise InvalidLocaleError
|
64
|
-
end
|
65
|
-
end
|
66
|
-
if user_signed_in?
|
67
|
-
locale = params[:locale] || session[:locale] || current_user.locale.try(:to_sym)
|
68
|
-
else
|
69
|
-
locale = params[:locale] || session[:locale]
|
70
|
-
end
|
71
|
-
if locale
|
72
|
-
I18n.locale = @locale = session[:locale] = locale.to_sym
|
73
|
-
else
|
74
|
-
I18n.locale = @locale = session[:locale] = I18n.default_locale
|
75
|
-
end
|
76
|
-
rescue InvalidLocaleError
|
77
|
-
@locale = I18n.default_locale
|
78
|
-
end
|
79
|
-
|
80
|
-
def solr_commit
|
81
|
-
Sunspot.commit
|
82
|
-
end
|
83
|
-
|
84
|
-
def convert_charset
|
85
|
-
case params[:format]
|
86
|
-
when 'csv'
|
87
|
-
return unless Setting.csv_charset_conversion
|
88
|
-
# TODO: 他の言語
|
89
|
-
if @locale.to_sym == :ja
|
90
|
-
headers["Content-Type"] = "text/csv; charset=Shift_JIS"
|
91
|
-
response.body = NKF::nkf('-Ws', response.body)
|
92
|
-
end
|
93
|
-
when 'xml'
|
94
|
-
if @locale.to_sym == :ja
|
95
|
-
headers["Content-Type"] = "application/xml; charset=Shift_JIS"
|
96
|
-
response.body = NKF::nkf('-Ws', response.body)
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
def store_page
|
102
|
-
flash[:page] = params[:page] if params[:page].to_i > 0
|
103
|
-
end
|
104
|
-
|
105
|
-
def store_location
|
106
|
-
if request.get? and request.format.try(:html?) and !request.xhr?
|
107
|
-
session[:user_return_to] = request.fullpath
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
def move_position(resource, direction)
|
112
|
-
if ['higher', 'lower'].include?(direction)
|
113
|
-
resource.send("move_#{direction}")
|
114
|
-
redirect_to url_for(:controller => resource.class.to_s.pluralize.underscore)
|
115
|
-
return
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
class InvalidLocaleError < StandardError
|
121
8
|
end
|
@@ -3,7 +3,7 @@ require File.expand_path('../boot', __FILE__)
|
|
3
3
|
require 'rails/all'
|
4
4
|
|
5
5
|
Bundler.require
|
6
|
-
require
|
6
|
+
require 'enju_circulation'
|
7
7
|
|
8
8
|
module Dummy
|
9
9
|
class Application < Rails::Application
|
@@ -55,6 +55,5 @@ module Dummy
|
|
55
55
|
end
|
56
56
|
|
57
57
|
require 'nkf'
|
58
|
-
require '
|
59
|
-
require 'enju_library'
|
58
|
+
require 'enju_leaf'
|
60
59
|
require 'mobylette'
|
Binary file
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended to check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:version =>
|
14
|
+
ActiveRecord::Schema.define(:version => 20130519065837) do
|
15
15
|
|
16
16
|
create_table "baskets", :force => true do |t|
|
17
17
|
t.integer "user_id"
|
@@ -57,11 +57,12 @@ ActiveRecord::Schema.define(:version => 20130509185724) do
|
|
57
57
|
add_index "checked_items", ["item_id"], :name => "index_checked_items_on_item_id"
|
58
58
|
|
59
59
|
create_table "checkins", :force => true do |t|
|
60
|
-
t.integer "item_id",
|
60
|
+
t.integer "item_id", :null => false
|
61
61
|
t.integer "librarian_id"
|
62
62
|
t.integer "basket_id"
|
63
|
-
t.datetime "created_at",
|
64
|
-
t.datetime "updated_at",
|
63
|
+
t.datetime "created_at", :null => false
|
64
|
+
t.datetime "updated_at", :null => false
|
65
|
+
t.integer "lock_version", :default => 0, :null => false
|
65
66
|
end
|
66
67
|
|
67
68
|
add_index "checkins", ["basket_id"], :name => "index_checkins_on_basket_id"
|
@@ -307,16 +308,16 @@ ActiveRecord::Schema.define(:version => 20130509185724) do
|
|
307
308
|
add_index "languages", ["name"], :name => "index_languages_on_name", :unique => true
|
308
309
|
|
309
310
|
create_table "lending_policies", :force => true do |t|
|
310
|
-
t.integer "item_id",
|
311
|
-
t.integer "user_group_id",
|
312
|
-
t.integer "loan_period", :default => 0,
|
311
|
+
t.integer "item_id", :null => false
|
312
|
+
t.integer "user_group_id", :null => false
|
313
|
+
t.integer "loan_period", :default => 0, :null => false
|
313
314
|
t.datetime "fixed_due_date"
|
314
|
-
t.integer "renewal", :default => 0,
|
315
|
-
t.
|
315
|
+
t.integer "renewal", :default => 0, :null => false
|
316
|
+
t.integer "fine", :default => 0, :null => false
|
316
317
|
t.text "note"
|
317
318
|
t.integer "position"
|
318
|
-
t.datetime "created_at",
|
319
|
-
t.datetime "updated_at",
|
319
|
+
t.datetime "created_at", :null => false
|
320
|
+
t.datetime "updated_at", :null => false
|
320
321
|
end
|
321
322
|
|
322
323
|
add_index "lending_policies", ["item_id", "user_group_id"], :name => "index_lending_policies_on_item_id_and_user_group_id", :unique => true
|
@@ -751,6 +752,7 @@ ActiveRecord::Schema.define(:version => 20130509185724) do
|
|
751
752
|
t.boolean "expiration_notice_to_library", :default => false
|
752
753
|
t.datetime "retained_at"
|
753
754
|
t.datetime "postponed_at"
|
755
|
+
t.integer "lock_version", :default => 0, :null => false
|
754
756
|
end
|
755
757
|
|
756
758
|
add_index "reserves", ["item_id"], :name => "index_reserves_on_item_id"
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
Binary file
|
Binary file
|
data/spec/fixtures/checkins.yml
CHANGED
@@ -6,6 +6,7 @@ checkin_00001:
|
|
6
6
|
librarian_id: 1
|
7
7
|
created_at: 2008-01-22 12:58:54.347742 +09:00
|
8
8
|
basket_id: 9
|
9
|
+
lock_version: 0
|
9
10
|
checkin_00002:
|
10
11
|
item_id: 9
|
11
12
|
updated_at: 2007-12-14 00:28:41.854022 +09:00
|
@@ -13,6 +14,7 @@ checkin_00002:
|
|
13
14
|
librarian_id: 2
|
14
15
|
created_at: 2007-12-14 00:28:41.854022 +09:00
|
15
16
|
basket_id: 10
|
17
|
+
lock_version: 0
|
16
18
|
checkin_00003:
|
17
19
|
item_id: 8
|
18
20
|
updated_at: 2007-12-20 21:24:18.729192 +09:00
|
@@ -20,6 +22,7 @@ checkin_00003:
|
|
20
22
|
librarian_id: 1
|
21
23
|
created_at: 2007-12-20 21:24:18.729192 +09:00
|
22
24
|
basket_id: 10
|
25
|
+
lock_version: 0
|
23
26
|
checkin_00004:
|
24
27
|
item_id: 7
|
25
28
|
updated_at: 2008-01-23 00:39:27.785676 +09:00
|
@@ -27,6 +30,7 @@ checkin_00004:
|
|
27
30
|
librarian_id: 2
|
28
31
|
created_at: 2008-01-23 00:39:27.785676 +09:00
|
29
32
|
basket_id: 10
|
33
|
+
lock_version: 0
|
30
34
|
checkin_00005:
|
31
35
|
item_id: 6
|
32
36
|
updated_at: 2007-12-20 21:25:04.619479 +09:00
|
@@ -34,6 +38,7 @@ checkin_00005:
|
|
34
38
|
librarian_id: 1
|
35
39
|
created_at: 2007-12-20 21:25:04.619479 +09:00
|
36
40
|
basket_id: 10
|
41
|
+
lock_version: 0
|
37
42
|
|
38
43
|
# == Schema Information
|
39
44
|
#
|
@@ -45,5 +50,6 @@ checkin_00005:
|
|
45
50
|
# basket_id :integer
|
46
51
|
# created_at :datetime not null
|
47
52
|
# updated_at :datetime not null
|
53
|
+
# lock_version :integer default(0), not null
|
48
54
|
#
|
49
55
|
|
@@ -104,3 +104,17 @@ circulation_status_00016:
|
|
104
104
|
id: 16
|
105
105
|
note: ""
|
106
106
|
position: 16
|
107
|
+
|
108
|
+
# == Schema Information
|
109
|
+
#
|
110
|
+
# Table name: circulation_statuses
|
111
|
+
#
|
112
|
+
# id :integer not null, primary key
|
113
|
+
# name :string(255) not null
|
114
|
+
# display_name :text
|
115
|
+
# note :text
|
116
|
+
# position :integer
|
117
|
+
# created_at :datetime not null
|
118
|
+
# updated_at :datetime not null
|
119
|
+
#
|
120
|
+
|
@@ -90,7 +90,7 @@ lending_policy_00009:
|
|
90
90
|
# loan_period :integer default(0), not null
|
91
91
|
# fixed_due_date :datetime
|
92
92
|
# renewal :integer default(0), not null
|
93
|
-
# fine :
|
93
|
+
# fine :integer default(0), not null
|
94
94
|
# note :text
|
95
95
|
# position :integer
|
96
96
|
# created_at :datetime not null
|
data/spec/fixtures/reserves.yml
CHANGED
@@ -8,6 +8,7 @@ reserve_00001:
|
|
8
8
|
created_at: 2007-09-01 14:14:52.356803 +09:00
|
9
9
|
expired_at: <%= 1.week.from_now %>
|
10
10
|
state: requested
|
11
|
+
lock_version: 0
|
11
12
|
reserve_00002:
|
12
13
|
updated_at: 2007-09-01 14:20:05.530854 +09:00
|
13
14
|
manifestation_id: 5
|
@@ -17,6 +18,7 @@ reserve_00002:
|
|
17
18
|
created_at: 2007-09-01 14:20:05.530854 +09:00
|
18
19
|
expired_at: <%= 1.week.from_now %>
|
19
20
|
state: requested
|
21
|
+
lock_version: 0
|
20
22
|
reserve_00003:
|
21
23
|
updated_at: 2007-09-02 17:46:52.791614 +09:00
|
22
24
|
manifestation_id: 6
|
@@ -26,6 +28,7 @@ reserve_00003:
|
|
26
28
|
created_at: 2007-09-02 17:46:52.791614 +09:00
|
27
29
|
expired_at: <%= 1.week.from_now %>
|
28
30
|
state: requested
|
31
|
+
lock_version: 0
|
29
32
|
reserve_00004:
|
30
33
|
updated_at: 2007-09-02 18:37:25.576087 +09:00
|
31
34
|
manifestation_id: 7
|
@@ -35,6 +38,7 @@ reserve_00004:
|
|
35
38
|
created_at: 2007-09-02 18:37:25.576087 +09:00
|
36
39
|
expired_at: <%= 1.week.from_now %>
|
37
40
|
state: requested
|
41
|
+
lock_version: 0
|
38
42
|
reserve_00005:
|
39
43
|
updated_at: 2007-09-02 19:16:55.714812 +09:00
|
40
44
|
manifestation_id: 8
|
@@ -44,6 +48,7 @@ reserve_00005:
|
|
44
48
|
created_at: 2007-09-02 19:16:55.714812 +09:00
|
45
49
|
expired_at: <%= 1.week.from_now %>
|
46
50
|
state: requested
|
51
|
+
lock_version: 0
|
47
52
|
reserve_00006:
|
48
53
|
updated_at: 2007-09-02 19:20:06.530854 +09:00
|
49
54
|
manifestation_id: 4
|
@@ -53,6 +58,7 @@ reserve_00006:
|
|
53
58
|
created_at: 2007-09-02 19:20:06.530854 +09:00
|
54
59
|
expired_at: <%= 1.week.from_now %>
|
55
60
|
state: requested
|
61
|
+
lock_version: 0
|
56
62
|
reserve_00007:
|
57
63
|
updated_at: 2007-09-02 19:20:07.530854 +09:00
|
58
64
|
manifestation_id: 2
|
@@ -62,6 +68,7 @@ reserve_00007:
|
|
62
68
|
created_at: 2007-09-02 19:20:07.530854 +09:00
|
63
69
|
expired_at: <%= 1.week.from_now %>
|
64
70
|
state: requested
|
71
|
+
lock_version: 0
|
65
72
|
reserve_00008:
|
66
73
|
updated_at: 2007-09-02 19:46:53.791614 +09:00
|
67
74
|
manifestation_id: 6
|
@@ -71,6 +78,7 @@ reserve_00008:
|
|
71
78
|
created_at: 2007-09-02 19:46:53.791614 +09:00
|
72
79
|
expired_at: <%= 1.week.ago %>
|
73
80
|
state: expired
|
81
|
+
lock_version: 0
|
74
82
|
reserve_00009:
|
75
83
|
updated_at: 2007-09-02 19:46:54.791614 +09:00
|
76
84
|
manifestation_id: 7
|
@@ -80,6 +88,7 @@ reserve_00009:
|
|
80
88
|
created_at: 2007-09-02 19:46:54.791614 +09:00
|
81
89
|
expired_at: <%= 1.day.ago %>
|
82
90
|
state: requested
|
91
|
+
lock_version: 0
|
83
92
|
reserve_00010:
|
84
93
|
updated_at: 2007-09-02 19:46:55.791614 +09:00
|
85
94
|
manifestation_id: 8
|
@@ -91,6 +100,7 @@ reserve_00010:
|
|
91
100
|
checked_out_at: <%= 1.week.ago %>
|
92
101
|
state: completed
|
93
102
|
item_id: 25
|
103
|
+
lock_version: 0
|
94
104
|
reserve_00011:
|
95
105
|
updated_at: 2007-09-03 14:20:05.530854 +09:00
|
96
106
|
manifestation_id: 7
|
@@ -100,6 +110,7 @@ reserve_00011:
|
|
100
110
|
created_at: 2007-09-03 14:20:05.530854 +09:00
|
101
111
|
expired_at: <%= 1.day.ago %>
|
102
112
|
state: expired
|
113
|
+
lock_version: 0
|
103
114
|
reserve_00012:
|
104
115
|
updated_at: 2007-09-03 14:20:06.530854 +09:00
|
105
116
|
manifestation_id: 8
|
@@ -109,6 +120,7 @@ reserve_00012:
|
|
109
120
|
created_at: 2007-09-03 14:20:06.530854 +09:00
|
110
121
|
expired_at: <%= 1.day.ago %>
|
111
122
|
state: retained
|
123
|
+
lock_version: 0
|
112
124
|
reserve_00013:
|
113
125
|
updated_at: 2007-09-03 14:20:07.530854 +09:00
|
114
126
|
manifestation_id: 11
|
@@ -118,6 +130,7 @@ reserve_00013:
|
|
118
130
|
created_at: 2007-09-03 14:20:07.530854 +09:00
|
119
131
|
expired_at: <%= 1.day.ago %>
|
120
132
|
state: requested
|
133
|
+
lock_version: 0
|
121
134
|
reserve_00014:
|
122
135
|
updated_at: 2007-09-03 14:20:08.530854 +09:00
|
123
136
|
manifestation_id: 11
|
@@ -129,6 +142,7 @@ reserve_00014:
|
|
129
142
|
expired_at: <%= 1.day.from_now %>
|
130
143
|
state: retained
|
131
144
|
item_id: 21
|
145
|
+
lock_version: 0
|
132
146
|
reserve_00015:
|
133
147
|
updated_at: 2007-09-03 14:20:09.530854 +09:00
|
134
148
|
manifestation_id: 11
|
@@ -138,7 +152,7 @@ reserve_00015:
|
|
138
152
|
created_at: 2007-09-03 14:20:09.530854 +09:00
|
139
153
|
expired_at: <%= 1.day.from_now %>
|
140
154
|
state: requested
|
141
|
-
|
155
|
+
lock_version: 0
|
142
156
|
|
143
157
|
# == Schema Information
|
144
158
|
#
|
@@ -158,5 +172,8 @@ reserve_00015:
|
|
158
172
|
# state :string(255)
|
159
173
|
# expiration_notice_to_patron :boolean default(FALSE)
|
160
174
|
# expiration_notice_to_library :boolean default(FALSE)
|
175
|
+
# retained_at :datetime
|
176
|
+
# postponed_at :datetime
|
177
|
+
# lock_version :integer default(0), not null
|
161
178
|
#
|
162
179
|
|
data/spec/models/checkin_spec.rb
CHANGED
@@ -16,7 +16,7 @@ end
|
|
16
16
|
# loan_period :integer default(0), not null
|
17
17
|
# fixed_due_date :datetime
|
18
18
|
# renewal :integer default(0), not null
|
19
|
-
# fine :
|
19
|
+
# fine :integer default(0), not null
|
20
20
|
# note :text
|
21
21
|
# position :integer
|
22
22
|
# created_at :datetime not null
|
data/spec/models/reserve_spec.rb
CHANGED
@@ -117,5 +117,8 @@ end
|
|
117
117
|
# state :string(255)
|
118
118
|
# expiration_notice_to_patron :boolean default(FALSE)
|
119
119
|
# expiration_notice_to_library :boolean default(FALSE)
|
120
|
+
# retained_at :datetime
|
121
|
+
# postponed_at :datetime
|
122
|
+
# lock_version :integer default(0), not null
|
120
123
|
#
|
121
124
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_circulation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.pre28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kosuke Tanabe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: enju_biblio
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.0.
|
19
|
+
version: 0.1.0.pre41
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.0.
|
26
|
+
version: 0.1.0.pre41
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: enju_library
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.1.17.pre12
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: enju_leaf
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.1.0.rc2
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.1.0.rc2
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: sqlite3
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -395,6 +409,8 @@ files:
|
|
395
409
|
- db/migrate/20130303124821_add_retained_at_to_reserve.rb
|
396
410
|
- db/migrate/20130304015019_add_postponed_at_to_reserve.rb
|
397
411
|
- db/migrate/20130416054135_add_circulation_status_id_to_item.rb
|
412
|
+
- db/migrate/20130519065638_add_lock_version_to_reserve.rb
|
413
|
+
- db/migrate/20130519065837_add_lock_version_to_checkin.rb
|
398
414
|
- lib/enju_circulation/controller.rb
|
399
415
|
- lib/enju_circulation/engine.rb
|
400
416
|
- lib/enju_circulation/helper.rb
|
@@ -570,16 +586,16 @@ files:
|
|
570
586
|
- spec/dummy/solr/conf/spellings.txt
|
571
587
|
- spec/dummy/solr/conf/stopwords.txt
|
572
588
|
- spec/dummy/solr/conf/synonyms.txt
|
573
|
-
- spec/dummy/solr/data/test/index/
|
574
|
-
- spec/dummy/solr/data/test/index/
|
575
|
-
- spec/dummy/solr/data/test/index/
|
576
|
-
- spec/dummy/solr/data/test/index/
|
577
|
-
- spec/dummy/solr/data/test/index/
|
578
|
-
- spec/dummy/solr/data/test/index/
|
579
|
-
- spec/dummy/solr/data/test/index/
|
580
|
-
- spec/dummy/solr/data/test/index/
|
589
|
+
- spec/dummy/solr/data/test/index/_2fp.fdt
|
590
|
+
- spec/dummy/solr/data/test/index/_2fp.fdx
|
591
|
+
- spec/dummy/solr/data/test/index/_2fp.fnm
|
592
|
+
- spec/dummy/solr/data/test/index/_2fp.frq
|
593
|
+
- spec/dummy/solr/data/test/index/_2fp.nrm
|
594
|
+
- spec/dummy/solr/data/test/index/_2fp.prx
|
595
|
+
- spec/dummy/solr/data/test/index/_2fp.tii
|
596
|
+
- spec/dummy/solr/data/test/index/_2fp.tis
|
581
597
|
- spec/dummy/solr/data/test/index/segments.gen
|
582
|
-
- spec/dummy/solr/data/test/index/
|
598
|
+
- spec/dummy/solr/data/test/index/segments_4v7
|
583
599
|
- spec/dummy/solr/data/test/spellchecker/segments.gen
|
584
600
|
- spec/dummy/solr/data/test/spellchecker/segments_1
|
585
601
|
- spec/factories/basket.rb
|
@@ -848,16 +864,16 @@ test_files:
|
|
848
864
|
- spec/dummy/solr/conf/spellings.txt
|
849
865
|
- spec/dummy/solr/conf/stopwords.txt
|
850
866
|
- spec/dummy/solr/conf/synonyms.txt
|
851
|
-
- spec/dummy/solr/data/test/index/
|
852
|
-
- spec/dummy/solr/data/test/index/
|
853
|
-
- spec/dummy/solr/data/test/index/
|
854
|
-
- spec/dummy/solr/data/test/index/
|
855
|
-
- spec/dummy/solr/data/test/index/
|
856
|
-
- spec/dummy/solr/data/test/index/
|
857
|
-
- spec/dummy/solr/data/test/index/
|
858
|
-
- spec/dummy/solr/data/test/index/
|
867
|
+
- spec/dummy/solr/data/test/index/_2fp.fdt
|
868
|
+
- spec/dummy/solr/data/test/index/_2fp.fdx
|
869
|
+
- spec/dummy/solr/data/test/index/_2fp.fnm
|
870
|
+
- spec/dummy/solr/data/test/index/_2fp.frq
|
871
|
+
- spec/dummy/solr/data/test/index/_2fp.nrm
|
872
|
+
- spec/dummy/solr/data/test/index/_2fp.prx
|
873
|
+
- spec/dummy/solr/data/test/index/_2fp.tii
|
874
|
+
- spec/dummy/solr/data/test/index/_2fp.tis
|
859
875
|
- spec/dummy/solr/data/test/index/segments.gen
|
860
|
-
- spec/dummy/solr/data/test/index/
|
876
|
+
- spec/dummy/solr/data/test/index/segments_4v7
|
861
877
|
- spec/dummy/solr/data/test/spellchecker/segments.gen
|
862
878
|
- spec/dummy/solr/data/test/spellchecker/segments_1
|
863
879
|
- spec/factories/basket.rb
|