enju_circulation 0.1.0.pre10 → 0.1.0.pre11
Sign up to get free protection for your applications and to get access to all the features.
- data/config/routes.rb +0 -5
- data/lib/enju_circulation/version.rb +1 -1
- data/spec/dummy/config/application.rb +1 -2
- data/spec/dummy/db/test.sqlite3 +0 -0
- metadata +10 -51
- data/app/models/basket.rb +0 -63
- data/spec/dummy/solr/data/test/index/_m7.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_m7.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_m7.fnm +0 -6
- data/spec/dummy/solr/data/test/index/_m7.frq +0 -1
- data/spec/dummy/solr/data/test/index/_m7.nrm +0 -1
- data/spec/dummy/solr/data/test/index/_m7.prx +0 -0
- data/spec/dummy/solr/data/test/index/_m7.tii +0 -0
- data/spec/dummy/solr/data/test/index/_m7.tis +0 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/segments_19j +0 -0
- data/spec/dummy/solr/data/test/spellchecker/segments.gen +0 -0
- data/spec/dummy/solr/data/test/spellchecker/segments_1 +0 -0
data/config/routes.rb
CHANGED
@@ -40,9 +40,4 @@ Rails.application.routes.draw do
|
|
40
40
|
resources :checkout_stat_has_users
|
41
41
|
resources :reserve_stat_has_manifestations
|
42
42
|
resources :reserve_stat_has_users
|
43
|
-
|
44
|
-
resources :baskets do
|
45
|
-
resources :accepts, :except => [:edit, :update]
|
46
|
-
end
|
47
|
-
resources :accepts, :except => [:edit, :update]
|
48
43
|
end
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.pre11
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-02-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -178,7 +178,7 @@ dependencies:
|
|
178
178
|
requirements:
|
179
179
|
- - ~>
|
180
180
|
- !ruby/object:Gem::Version
|
181
|
-
version: 2.0.0.pre.
|
181
|
+
version: 2.0.0.pre.130115
|
182
182
|
type: :development
|
183
183
|
prerelease: false
|
184
184
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -186,7 +186,7 @@ dependencies:
|
|
186
186
|
requirements:
|
187
187
|
- - ~>
|
188
188
|
- !ruby/object:Gem::Version
|
189
|
-
version: 2.0.0.pre.
|
189
|
+
version: 2.0.0.pre.130115
|
190
190
|
- !ruby/object:Gem::Dependency
|
191
191
|
name: enju_biblio
|
192
192
|
requirement: !ruby/object:Gem::Requirement
|
@@ -194,7 +194,7 @@ dependencies:
|
|
194
194
|
requirements:
|
195
195
|
- - ~>
|
196
196
|
- !ruby/object:Gem::Version
|
197
|
-
version: 0.1.0.
|
197
|
+
version: 0.1.0.pre17
|
198
198
|
type: :development
|
199
199
|
prerelease: false
|
200
200
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -202,7 +202,7 @@ dependencies:
|
|
202
202
|
requirements:
|
203
203
|
- - ~>
|
204
204
|
- !ruby/object:Gem::Version
|
205
|
-
version: 0.1.0.
|
205
|
+
version: 0.1.0.pre17
|
206
206
|
- !ruby/object:Gem::Dependency
|
207
207
|
name: enju_library
|
208
208
|
requirement: !ruby/object:Gem::Requirement
|
@@ -210,7 +210,7 @@ dependencies:
|
|
210
210
|
requirements:
|
211
211
|
- - ~>
|
212
212
|
- !ruby/object:Gem::Version
|
213
|
-
version: 0.1.0.
|
213
|
+
version: 0.1.0.pre8
|
214
214
|
type: :development
|
215
215
|
prerelease: false
|
216
216
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -218,7 +218,7 @@ dependencies:
|
|
218
218
|
requirements:
|
219
219
|
- - ~>
|
220
220
|
- !ruby/object:Gem::Version
|
221
|
-
version: 0.1.0.
|
221
|
+
version: 0.1.0.pre8
|
222
222
|
- !ruby/object:Gem::Dependency
|
223
223
|
name: enju_export
|
224
224
|
requirement: !ruby/object:Gem::Requirement
|
@@ -236,23 +236,7 @@ dependencies:
|
|
236
236
|
- !ruby/object:Gem::Version
|
237
237
|
version: 0.1.1.pre
|
238
238
|
- !ruby/object:Gem::Dependency
|
239
|
-
name:
|
240
|
-
requirement: !ruby/object:Gem::Requirement
|
241
|
-
none: false
|
242
|
-
requirements:
|
243
|
-
- - ! '>='
|
244
|
-
- !ruby/object:Gem::Version
|
245
|
-
version: '0'
|
246
|
-
type: :development
|
247
|
-
prerelease: false
|
248
|
-
version_requirements: !ruby/object:Gem::Requirement
|
249
|
-
none: false
|
250
|
-
requirements:
|
251
|
-
- - ! '>='
|
252
|
-
- !ruby/object:Gem::Version
|
253
|
-
version: '0'
|
254
|
-
- !ruby/object:Gem::Dependency
|
255
|
-
name: mobile-fu
|
239
|
+
name: mobylette
|
256
240
|
requirement: !ruby/object:Gem::Requirement
|
257
241
|
none: false
|
258
242
|
requirements:
|
@@ -311,7 +295,6 @@ files:
|
|
311
295
|
- app/controllers/user_group_has_checkout_types_controller.rb
|
312
296
|
- app/controllers/user_reserve_stats_controller.rb
|
313
297
|
- app/helpers/reserves_helper.rb
|
314
|
-
- app/models/basket.rb
|
315
298
|
- app/models/carrier_type_has_checkout_type.rb
|
316
299
|
- app/models/checked_item.rb
|
317
300
|
- app/models/checkin.rb
|
@@ -655,18 +638,6 @@ files:
|
|
655
638
|
- spec/dummy/solr/conf/spellings.txt
|
656
639
|
- spec/dummy/solr/conf/stopwords.txt
|
657
640
|
- spec/dummy/solr/conf/synonyms.txt
|
658
|
-
- spec/dummy/solr/data/test/index/_m7.fdt
|
659
|
-
- spec/dummy/solr/data/test/index/_m7.fdx
|
660
|
-
- spec/dummy/solr/data/test/index/_m7.fnm
|
661
|
-
- spec/dummy/solr/data/test/index/_m7.frq
|
662
|
-
- spec/dummy/solr/data/test/index/_m7.nrm
|
663
|
-
- spec/dummy/solr/data/test/index/_m7.prx
|
664
|
-
- spec/dummy/solr/data/test/index/_m7.tii
|
665
|
-
- spec/dummy/solr/data/test/index/_m7.tis
|
666
|
-
- spec/dummy/solr/data/test/index/segments.gen
|
667
|
-
- spec/dummy/solr/data/test/index/segments_19j
|
668
|
-
- spec/dummy/solr/data/test/spellchecker/segments.gen
|
669
|
-
- spec/dummy/solr/data/test/spellchecker/segments_1
|
670
641
|
- spec/factories/basket.rb
|
671
642
|
- spec/factories/carrier_type.rb
|
672
643
|
- spec/factories/carrier_type_has_checkout_type.rb
|
@@ -769,7 +740,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
769
740
|
version: '0'
|
770
741
|
segments:
|
771
742
|
- 0
|
772
|
-
hash: -
|
743
|
+
hash: -4520022407013796121
|
773
744
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
774
745
|
none: false
|
775
746
|
requirements:
|
@@ -933,18 +904,6 @@ test_files:
|
|
933
904
|
- spec/dummy/solr/conf/spellings.txt
|
934
905
|
- spec/dummy/solr/conf/stopwords.txt
|
935
906
|
- spec/dummy/solr/conf/synonyms.txt
|
936
|
-
- spec/dummy/solr/data/test/index/_m7.fdt
|
937
|
-
- spec/dummy/solr/data/test/index/_m7.fdx
|
938
|
-
- spec/dummy/solr/data/test/index/_m7.fnm
|
939
|
-
- spec/dummy/solr/data/test/index/_m7.frq
|
940
|
-
- spec/dummy/solr/data/test/index/_m7.nrm
|
941
|
-
- spec/dummy/solr/data/test/index/_m7.prx
|
942
|
-
- spec/dummy/solr/data/test/index/_m7.tii
|
943
|
-
- spec/dummy/solr/data/test/index/_m7.tis
|
944
|
-
- spec/dummy/solr/data/test/index/segments.gen
|
945
|
-
- spec/dummy/solr/data/test/index/segments_19j
|
946
|
-
- spec/dummy/solr/data/test/spellchecker/segments.gen
|
947
|
-
- spec/dummy/solr/data/test/spellchecker/segments_1
|
948
907
|
- spec/factories/basket.rb
|
949
908
|
- spec/factories/carrier_type.rb
|
950
909
|
- spec/factories/carrier_type_has_checkout_type.rb
|
data/app/models/basket.rb
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
class Basket < ActiveRecord::Base
|
2
|
-
attr_accessible :note, :user_number
|
3
|
-
default_scope :order => 'baskets.id DESC'
|
4
|
-
scope :will_expire, lambda {|date| {:conditions => ['created_at < ?', date]}}
|
5
|
-
belongs_to :user, :validate => true
|
6
|
-
has_many :accepts
|
7
|
-
|
8
|
-
validates_associated :user, :on => :create
|
9
|
-
# 貸出完了後にかごのユーザidは破棄する
|
10
|
-
validates_presence_of :user, :on => :create
|
11
|
-
validate :check_suspended
|
12
|
-
|
13
|
-
attr_accessor :user_number
|
14
|
-
|
15
|
-
def check_suspended
|
16
|
-
if user
|
17
|
-
errors[:base] << I18n.t('basket.this_account_is_suspended') if user.locked_at
|
18
|
-
else
|
19
|
-
errors[:base] << I18n.t('user.not_found')
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.expire
|
24
|
-
Basket.will_expire(Time.zone.now.beginning_of_day).destroy_all
|
25
|
-
logger.info "#{Time.zone.now} baskets expired!"
|
26
|
-
end
|
27
|
-
|
28
|
-
if defined?(EnjuCirculation)
|
29
|
-
has_many :checked_items, :dependent => :destroy
|
30
|
-
has_many :items, :through => :checked_items
|
31
|
-
has_many :checkouts
|
32
|
-
has_many :checkins
|
33
|
-
|
34
|
-
def basket_checkout(librarian)
|
35
|
-
return nil if checked_items.size == 0
|
36
|
-
Item.transaction do
|
37
|
-
checked_items.each do |checked_item|
|
38
|
-
checkout = user.checkouts.new
|
39
|
-
checkout.librarian = librarian
|
40
|
-
checkout.item = checked_item.item
|
41
|
-
checkout.basket = self
|
42
|
-
checkout.due_date = checked_item.due_date
|
43
|
-
checked_item.item.checkout!(user)
|
44
|
-
checkout.save!
|
45
|
-
end
|
46
|
-
CheckedItem.destroy_all(:basket_id => id)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
# == Schema Information
|
53
|
-
#
|
54
|
-
# Table name: baskets
|
55
|
-
#
|
56
|
-
# id :integer not null, primary key
|
57
|
-
# user_id :integer
|
58
|
-
# note :text
|
59
|
-
# lock_version :integer default(0), not null
|
60
|
-
# created_at :datetime not null
|
61
|
-
# updated_at :datetime not null
|
62
|
-
#
|
63
|
-
|
Binary file
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
NRM�
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|