enju_circulation 0.1.0.pre15 → 0.1.0.pre16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/enju_circulation/ability.rb +0 -6
- data/lib/enju_circulation/item.rb +1 -1
- data/lib/enju_circulation/manifestation.rb +1 -1
- data/lib/enju_circulation/user.rb +1 -1
- data/lib/enju_circulation/user_group.rb +20 -0
- data/lib/enju_circulation/version.rb +1 -1
- data/lib/enju_circulation.rb +5 -3
- data/spec/dummy/app/models/ability.rb +9 -14
- data/spec/dummy/app/models/user_group.rb +2 -13
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/{segments_1t1 → segments_261} +0 -0
- metadata +21 -20
- /data/spec/dummy/solr/data/test/index/{_wh.fdt → _12z.fdt} +0 -0
- /data/spec/dummy/solr/data/test/index/{_wh.fdx → _12z.fdx} +0 -0
- /data/spec/dummy/solr/data/test/index/{_wh.fnm → _12z.fnm} +0 -0
- /data/spec/dummy/solr/data/test/index/{_wh.frq → _12z.frq} +0 -0
- /data/spec/dummy/solr/data/test/index/{_wh.nrm → _12z.nrm} +0 -0
- /data/spec/dummy/solr/data/test/index/{_wh.prx → _12z.prx} +0 -0
- /data/spec/dummy/solr/data/test/index/{_wh.tii → _12z.tii} +0 -0
- /data/spec/dummy/solr/data/test/index/{_wh.tis → _12z.tis} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f86efed31c18ea347f1658523aab6bd370f1841
|
4
|
+
data.tar.gz: 61f456e339046fd324677c83eb51d1c87184919a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49d8ab628ce347d257b9f20eac121778fbf0a71b27087aa3aa38093519881406206a8f8744d1e387c0ad122d1087dd4c2fd0eeb70d1943da1662df84b8435991
|
7
|
+
data.tar.gz: 65f319e166213426075e0c833144bae589d1301980143ca532407ded3e60fccaa6586196b8723d82e7f66bd29a32f8029aa58429d4f371b9a8c54f8e681f2f9f
|
@@ -8,9 +8,6 @@ module EnjuCirculation
|
|
8
8
|
can [:destroy, :delete], Manifestation do |manifestation|
|
9
9
|
manifestation.items.empty? and !manifestation.periodical_master? and !manifestation.is_reserved?
|
10
10
|
end
|
11
|
-
can [:destroy, :delete], User do |u|
|
12
|
-
u.deletable? and u != user
|
13
|
-
end
|
14
11
|
can :manage, [
|
15
12
|
Basket,
|
16
13
|
CarrierTypeHasCheckoutType,
|
@@ -46,9 +43,6 @@ module EnjuCirculation
|
|
46
43
|
can [:destroy, :delete], Manifestation do |manifestation|
|
47
44
|
manifestation.items.empty? and !manifestation.periodical_master? and !manifestation.is_reserved?
|
48
45
|
end
|
49
|
-
can [:destroy, :delete], User do |u|
|
50
|
-
u.deletable? and u.role.name == 'User' and u != user
|
51
|
-
end
|
52
46
|
can :manage, [
|
53
47
|
Basket,
|
54
48
|
CheckedItem,
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module EnjuCirculation
|
2
|
+
module EnjuUserGroup
|
3
|
+
def self.included(base)
|
4
|
+
base.extend ClassMethods
|
5
|
+
end
|
6
|
+
|
7
|
+
module ClassMethods
|
8
|
+
def enju_circulation_user_group_model
|
9
|
+
has_many :user_group_has_checkout_types, :dependent => :destroy
|
10
|
+
has_many :checkout_types, :through => :user_group_has_checkout_types, :order => :position
|
11
|
+
has_many :lending_policies
|
12
|
+
|
13
|
+
validates_numericality_of :number_of_day_to_notify_due_date,
|
14
|
+
:number_of_day_to_notify_overdue,
|
15
|
+
:number_of_time_to_notify_overdue,
|
16
|
+
:greater_than_or_equal_to => 0
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/enju_circulation.rb
CHANGED
@@ -2,6 +2,7 @@ require "enju_circulation/engine"
|
|
2
2
|
require "enju_circulation/manifestation"
|
3
3
|
require "enju_circulation/item"
|
4
4
|
require "enju_circulation/user"
|
5
|
+
require "enju_circulation/user_group"
|
5
6
|
require "enju_circulation/controller"
|
6
7
|
require "enju_circulation/helper"
|
7
8
|
|
@@ -9,7 +10,8 @@ module EnjuCirculation
|
|
9
10
|
end
|
10
11
|
|
11
12
|
ActionController::Base.send :include, EnjuCirculation::Controller
|
12
|
-
ActiveRecord::Base.send :include, EnjuCirculation::
|
13
|
-
ActiveRecord::Base.send :include, EnjuCirculation::
|
14
|
-
ActiveRecord::Base.send :include, EnjuCirculation::
|
13
|
+
ActiveRecord::Base.send :include, EnjuCirculation::EnjuManifestation
|
14
|
+
ActiveRecord::Base.send :include, EnjuCirculation::EnjuItem
|
15
|
+
ActiveRecord::Base.send :include, EnjuCirculation::EnjuUser
|
16
|
+
ActiveRecord::Base.send :include, EnjuCirculation::EnjuUserGroup
|
15
17
|
ActionView::Base.send :include, EnjuCirculation::ManifestationsHelper
|
@@ -5,12 +5,9 @@
|
|
5
5
|
def initialize(user, ip_address = nil)
|
6
6
|
case user.try(:role).try(:name)
|
7
7
|
when 'Administrator'
|
8
|
-
can [:
|
8
|
+
can [:destroy, :delete], Manifestation do |manifestation|
|
9
9
|
manifestation.items.empty? and !manifestation.periodical_master? and !manifestation.is_reserved?
|
10
10
|
end
|
11
|
-
can [:delete, :destroy], User do |u|
|
12
|
-
u.deletable? and u != user
|
13
|
-
end
|
14
11
|
can :manage, [
|
15
12
|
Basket,
|
16
13
|
CarrierTypeHasCheckoutType,
|
@@ -30,7 +27,7 @@
|
|
30
27
|
UserReserveStat
|
31
28
|
]
|
32
29
|
can [:read, :create, :update, :remove_all], Checkout
|
33
|
-
can [:
|
30
|
+
can [:destroy, :delete], Checkout do |checkout|
|
34
31
|
checkout.checkin
|
35
32
|
end
|
36
33
|
can [:read, :update], [
|
@@ -38,18 +35,15 @@
|
|
38
35
|
LendingPolicy,
|
39
36
|
UseRestriction
|
40
37
|
]
|
41
|
-
can [:
|
38
|
+
can [:destroy, :delete], LendingPolicy
|
42
39
|
can :read, [Item, Manifestation]
|
43
40
|
when 'Librarian'
|
44
|
-
can [:
|
41
|
+
can [:destroy, :delete], Item do |item|
|
45
42
|
item.checkouts.not_returned.empty?
|
46
43
|
end
|
47
|
-
can [:
|
44
|
+
can [:destroy, :delete], Manifestation do |manifestation|
|
48
45
|
manifestation.items.empty? and !manifestation.periodical_master? and !manifestation.is_reserved?
|
49
46
|
end
|
50
|
-
can [:delete, :destroy], User do |u|
|
51
|
-
u.deletable? and u.role.name == 'User' and u != user
|
52
|
-
end
|
53
47
|
can :manage, [
|
54
48
|
Basket,
|
55
49
|
CheckedItem,
|
@@ -59,7 +53,7 @@
|
|
59
53
|
Reserve
|
60
54
|
]
|
61
55
|
can [:read, :create, :update, :remove_all], Checkout
|
62
|
-
can [:
|
56
|
+
can [:destroy, :delete], Checkout do |checkout|
|
63
57
|
checkout.checkin
|
64
58
|
end
|
65
59
|
can [:read, :create, :update], UserCheckoutStat
|
@@ -83,14 +77,14 @@
|
|
83
77
|
can [:show, :update], Checkout do |checkout|
|
84
78
|
checkout.user == user
|
85
79
|
end
|
86
|
-
can [:
|
80
|
+
can [:destroy, :delete], Checkout do |checkout|
|
87
81
|
checkout.user == user && checkout.checkin
|
88
82
|
end
|
89
83
|
can :index, Reserve
|
90
84
|
can :create, Reserve do |reserve|
|
91
85
|
user.user_number.present?
|
92
86
|
end
|
93
|
-
can [:show, :update, :
|
87
|
+
can [:show, :update, :destroy, :delete], Reserve do |reserve|
|
94
88
|
reserve.user == user
|
95
89
|
end
|
96
90
|
can :read, [
|
@@ -110,6 +104,7 @@
|
|
110
104
|
UserCheckoutStat,
|
111
105
|
UserReserveStat
|
112
106
|
]
|
107
|
+
can :read, [Item, Manifestation]
|
113
108
|
end
|
114
109
|
end
|
115
110
|
end
|
@@ -14,20 +14,9 @@ class UserGroup < ActiveRecord::Base
|
|
14
14
|
:greater_than_or_equal_to => 0,
|
15
15
|
:allow_blank => true
|
16
16
|
|
17
|
-
|
18
|
-
10
|
19
|
-
end
|
17
|
+
paginates_per 10
|
20
18
|
|
21
|
-
if defined?(EnjuCirculation)
|
22
|
-
has_many :user_group_has_checkout_types, :dependent => :destroy
|
23
|
-
has_many :checkout_types, :through => :user_group_has_checkout_types, :order => :position
|
24
|
-
has_many :lending_policies
|
25
|
-
|
26
|
-
validates_numericality_of :number_of_day_to_notify_due_date,
|
27
|
-
:number_of_day_to_notify_overdue,
|
28
|
-
:number_of_time_to_notify_overdue,
|
29
|
-
:greater_than_or_equal_to => 0
|
30
|
-
end
|
19
|
+
enju_circulation_user_group_model if defined?(EnjuCirculation)
|
31
20
|
end
|
32
21
|
|
33
22
|
# == Schema Information
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
Binary file
|
Binary file
|
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.pre16
|
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-03-
|
11
|
+
date: 2013-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -456,6 +456,7 @@ files:
|
|
456
456
|
- lib/enju_circulation/item.rb
|
457
457
|
- lib/enju_circulation/manifestation.rb
|
458
458
|
- lib/enju_circulation/user.rb
|
459
|
+
- lib/enju_circulation/user_group.rb
|
459
460
|
- lib/enju_circulation/version.rb
|
460
461
|
- lib/enju_circulation.rb
|
461
462
|
- lib/generators/enju_circulation/views_generator.rb
|
@@ -612,16 +613,16 @@ files:
|
|
612
613
|
- spec/dummy/solr/conf/spellings.txt
|
613
614
|
- spec/dummy/solr/conf/stopwords.txt
|
614
615
|
- spec/dummy/solr/conf/synonyms.txt
|
615
|
-
- spec/dummy/solr/data/test/index/
|
616
|
-
- spec/dummy/solr/data/test/index/
|
617
|
-
- spec/dummy/solr/data/test/index/
|
618
|
-
- spec/dummy/solr/data/test/index/
|
619
|
-
- spec/dummy/solr/data/test/index/
|
620
|
-
- spec/dummy/solr/data/test/index/
|
621
|
-
- spec/dummy/solr/data/test/index/
|
622
|
-
- spec/dummy/solr/data/test/index/
|
616
|
+
- spec/dummy/solr/data/test/index/_12z.fdt
|
617
|
+
- spec/dummy/solr/data/test/index/_12z.fdx
|
618
|
+
- spec/dummy/solr/data/test/index/_12z.fnm
|
619
|
+
- spec/dummy/solr/data/test/index/_12z.frq
|
620
|
+
- spec/dummy/solr/data/test/index/_12z.nrm
|
621
|
+
- spec/dummy/solr/data/test/index/_12z.prx
|
622
|
+
- spec/dummy/solr/data/test/index/_12z.tii
|
623
|
+
- spec/dummy/solr/data/test/index/_12z.tis
|
623
624
|
- spec/dummy/solr/data/test/index/segments.gen
|
624
|
-
- spec/dummy/solr/data/test/index/
|
625
|
+
- spec/dummy/solr/data/test/index/segments_261
|
625
626
|
- spec/dummy/solr/data/test/spellchecker/segments.gen
|
626
627
|
- spec/dummy/solr/data/test/spellchecker/segments_1
|
627
628
|
- spec/factories/basket.rb
|
@@ -885,16 +886,16 @@ test_files:
|
|
885
886
|
- spec/dummy/solr/conf/spellings.txt
|
886
887
|
- spec/dummy/solr/conf/stopwords.txt
|
887
888
|
- spec/dummy/solr/conf/synonyms.txt
|
888
|
-
- spec/dummy/solr/data/test/index/
|
889
|
-
- spec/dummy/solr/data/test/index/
|
890
|
-
- spec/dummy/solr/data/test/index/
|
891
|
-
- spec/dummy/solr/data/test/index/
|
892
|
-
- spec/dummy/solr/data/test/index/
|
893
|
-
- spec/dummy/solr/data/test/index/
|
894
|
-
- spec/dummy/solr/data/test/index/
|
895
|
-
- spec/dummy/solr/data/test/index/
|
889
|
+
- spec/dummy/solr/data/test/index/_12z.fdt
|
890
|
+
- spec/dummy/solr/data/test/index/_12z.fdx
|
891
|
+
- spec/dummy/solr/data/test/index/_12z.fnm
|
892
|
+
- spec/dummy/solr/data/test/index/_12z.frq
|
893
|
+
- spec/dummy/solr/data/test/index/_12z.nrm
|
894
|
+
- spec/dummy/solr/data/test/index/_12z.prx
|
895
|
+
- spec/dummy/solr/data/test/index/_12z.tii
|
896
|
+
- spec/dummy/solr/data/test/index/_12z.tis
|
896
897
|
- spec/dummy/solr/data/test/index/segments.gen
|
897
|
-
- spec/dummy/solr/data/test/index/
|
898
|
+
- spec/dummy/solr/data/test/index/segments_261
|
898
899
|
- spec/dummy/solr/data/test/spellchecker/segments.gen
|
899
900
|
- spec/dummy/solr/data/test/spellchecker/segments_1
|
900
901
|
- spec/factories/basket.rb
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|