enju_circulation 0.0.61 → 0.0.62
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/basket.rb +4 -4
- data/lib/enju_circulation/version.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- metadata +5 -5
data/app/models/basket.rb
CHANGED
@@ -13,8 +13,8 @@ class Basket < ActiveRecord::Base
|
|
13
13
|
attr_accessor :user_number
|
14
14
|
|
15
15
|
def check_suspended
|
16
|
-
if
|
17
|
-
errors[:base] << I18n.t('basket.this_account_is_suspended') if
|
16
|
+
if user
|
17
|
+
errors[:base] << I18n.t('basket.this_account_is_suspended') if user.locked_at
|
18
18
|
else
|
19
19
|
errors[:base] << I18n.t('user.not_found')
|
20
20
|
end
|
@@ -34,8 +34,8 @@ class Basket < ActiveRecord::Base
|
|
34
34
|
def basket_checkout(librarian)
|
35
35
|
return nil if checked_items.size == 0
|
36
36
|
Item.transaction do
|
37
|
-
|
38
|
-
checkout =
|
37
|
+
checked_items.each do |checked_item|
|
38
|
+
checkout = user.checkouts.new
|
39
39
|
checkout.librarian = librarian
|
40
40
|
checkout.item = checked_item.item
|
41
41
|
checkout.basket = self
|
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.0.
|
4
|
+
version: 0.0.62
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - ! '>='
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 0.0.
|
101
|
+
version: 0.0.23
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -106,7 +106,7 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 0.0.
|
109
|
+
version: 0.0.23
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
111
|
name: enju_event
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +114,7 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - ! '>='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.0.
|
117
|
+
version: 0.0.24
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
requirements:
|
123
123
|
- - ! '>='
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.0.
|
125
|
+
version: 0.0.24
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: enju_core
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|