enju_circulation 0.0.71 → 0.1.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/app/controllers/checked_items_controller.rb +2 -2
  2. data/app/controllers/checkins_controller.rb +4 -4
  3. data/app/controllers/checkouts_controller.rb +2 -2
  4. data/app/controllers/manifestation_checkout_stats_controller.rb +2 -2
  5. data/app/controllers/manifestation_reserve_stats_controller.rb +2 -2
  6. data/app/controllers/user_checkout_stats_controller.rb +2 -2
  7. data/app/controllers/user_reserve_stats_controller.rb +2 -2
  8. data/app/models/checkin.rb +1 -3
  9. data/app/models/checkout.rb +1 -3
  10. data/app/models/checkout_stat_has_manifestation.rb +1 -3
  11. data/app/models/checkout_stat_has_user.rb +1 -3
  12. data/app/models/checkout_type.rb +1 -3
  13. data/app/models/item_has_use_restriction.rb +1 -3
  14. data/app/models/lending_policy.rb +1 -3
  15. data/app/models/manifestation_checkout_stat.rb +1 -3
  16. data/app/models/manifestation_reserve_stat.rb +1 -3
  17. data/app/models/reserve.rb +3 -4
  18. data/app/models/reserve_stat_has_manifestation.rb +1 -3
  19. data/app/models/reserve_stat_has_user.rb +1 -3
  20. data/app/models/user_checkout_stat.rb +1 -3
  21. data/app/models/user_reserve_stat.rb +1 -3
  22. data/app/views/baskets/index.html.erb +1 -1
  23. data/app/views/checked_items/index.html.erb +1 -1
  24. data/app/views/checkins/index.html.erb +1 -1
  25. data/app/views/checkout_stat_has_manifestations/index.html.erb +1 -1
  26. data/app/views/checkout_stat_has_users/index.html.erb +1 -1
  27. data/app/views/checkout_types/index.html.erb +1 -1
  28. data/app/views/checkouts/_list.html.erb +1 -1
  29. data/app/views/item_has_use_restrictions/index.html.erb +1 -1
  30. data/app/views/lending_policies/index.html.erb +1 -1
  31. data/app/views/manifestation_checkout_stats/index.html.erb +1 -1
  32. data/app/views/manifestation_checkout_stats/show.html.erb +1 -1
  33. data/app/views/manifestation_reserve_stats/index.html.erb +1 -1
  34. data/app/views/manifestation_reserve_stats/show.html.erb +1 -1
  35. data/app/views/reserve_stat_has_manifestations/index.html.erb +1 -1
  36. data/app/views/reserve_stat_has_users/index.html.erb +1 -1
  37. data/app/views/reserves/index.html.erb +1 -1
  38. data/app/views/user_checkout_stats/index.html.erb +1 -1
  39. data/app/views/user_checkout_stats/show.html.erb +1 -1
  40. data/app/views/user_reserve_stats/index.html.erb +1 -1
  41. data/app/views/user_reserve_stats/show.html.erb +1 -1
  42. data/lib/enju_circulation/controller.rb +0 -4
  43. data/lib/enju_circulation/version.rb +1 -1
  44. data/lib/generators/enju_circulation/views_generator.rb +38 -0
  45. data/spec/dummy/app/mailers/notifier.rb +5 -4
  46. data/spec/dummy/app/models/ability.rb +0 -2
  47. data/spec/dummy/app/models/local_patron.rb +13 -0
  48. data/spec/dummy/app/models/user.rb +8 -0
  49. data/spec/dummy/config/application.rb +4 -1
  50. data/spec/dummy/db/schema.rb +0 -11
  51. data/spec/dummy/db/test.sqlite3 +0 -0
  52. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  53. data/spec/dummy/solr/data/test/index/segments_1 +0 -0
  54. data/spec/dummy/solr/data/test/spellchecker/segments_1 +0 -0
  55. metadata +46 -64
  56. data/app/controllers/accepts_controller.rb +0 -83
  57. data/app/models/accept.rb +0 -36
  58. data/db/migrate/20120319173203_create_accepts.rb +0 -14
  59. data/spec/controllers/accepts_controller_spec.rb +0 -304
  60. data/spec/dummy/lib/enju_leaf/calculate_stat.rb +0 -30
  61. data/spec/dummy/lib/enju_leaf/expire_editable_fragment.rb +0 -30
  62. data/spec/dummy/lib/enju_leaf/expire_fragment_cache.rb +0 -17
  63. data/spec/dummy/lib/enju_leaf/import_file.rb +0 -13
  64. data/spec/dummy/lib/enju_leaf/localized_name.rb +0 -13
  65. data/spec/dummy/lib/enju_leaf/master_model.rb +0 -19
  66. data/spec/dummy/lib/enju_leaf/url_validator.rb +0 -10
  67. data/spec/dummy/lib/enju_leaf.rb +0 -5
  68. data/spec/dummy/solr/data/test/index/_2r.fdt +0 -0
  69. data/spec/dummy/solr/data/test/index/_2r.fdx +0 -0
  70. data/spec/dummy/solr/data/test/index/_2r.fnm +0 -6
  71. data/spec/dummy/solr/data/test/index/_2r.frq +0 -1
  72. data/spec/dummy/solr/data/test/index/_2r.nrm +0 -1
  73. data/spec/dummy/solr/data/test/index/_2r.prx +0 -0
  74. data/spec/dummy/solr/data/test/index/_2r.tii +0 -0
  75. data/spec/dummy/solr/data/test/index/_2r.tis +0 -0
  76. data/spec/dummy/solr/data/test/index/segments_6n +0 -0
  77. data/spec/factories/accepts.rb +0 -9
  78. data/spec/models/accept_spec.rb +0 -22
  79. data/spec/requests/accepts_spec.rb +0 -11
  80. data/spec/routing/accepts_routing_spec.rb +0 -27
  81. data/spec/views/accepts/edit.html.erb_spec.rb +0 -18
  82. data/spec/views/accepts/index.html.erb_spec.rb +0 -25
  83. data/spec/views/accepts/new.html.erb_spec.rb +0 -29
  84. data/spec/views/accepts/show.html.erb_spec.rb +0 -17
@@ -6,9 +6,9 @@ class CheckedItemsController < ApplicationController
6
6
  # GET /checked_items.json
7
7
  def index
8
8
  if @basket
9
- @checked_items = @basket.checked_items.paginate(:page => params[:page])
9
+ @checked_items = @basket.checked_items.page(params[:page])
10
10
  else
11
- @checked_items = CheckedItem.paginate(:page => params[:page])
11
+ @checked_items = CheckedItem.page(params[:page])
12
12
  end
13
13
 
14
14
  respond_to do |format|
@@ -8,9 +8,9 @@ class CheckinsController < ApplicationController
8
8
  # GET /checkins.json
9
9
  def index
10
10
  if @basket
11
- @checkins = @basket.checkins.paginate(:page => params[:page])
11
+ @checkins = @basket.checkins.page(params[:page])
12
12
  else
13
- @checkins = Checkin.paginate(:page => params[:page])
13
+ @checkins = Checkin.page(params[:page])
14
14
  end
15
15
 
16
16
  respond_to do |format|
@@ -42,7 +42,7 @@ class CheckinsController < ApplicationController
42
42
  @basket.save!
43
43
  end
44
44
  @checkin = Checkin.new
45
- @checkins = [].paginate(:page => 1)
45
+ @checkins = Kaminari::paginate_array([]).page(1)
46
46
  flash[:checkin_basket_id] = @basket.id
47
47
 
48
48
  respond_to do |format|
@@ -81,7 +81,7 @@ class CheckinsController < ApplicationController
81
81
  format.json { render :json => @checkin, :status => :created, :location => @checkin }
82
82
  format.js { redirect_to basket_checkins_url(@basket, :format => :js) }
83
83
  else
84
- @checkins = @basket.checkins.paginate(:page => 1)
84
+ @checkins = @basket.checkins.page(1)
85
85
  format.html { render :action => "new" }
86
86
  format.json { render :json => @checkin.errors, :status => :unprocessable_entity }
87
87
  format.js { render :action => "index" }
@@ -27,7 +27,7 @@ class CheckoutsController < ApplicationController
27
27
  if params[:format] == 'csv'
28
28
  per_page = 65534
29
29
  else
30
- per_page = Checkout.per_page
30
+ per_page = Checkout.default_per_page
31
31
  end
32
32
 
33
33
  unless icalendar_user
@@ -101,7 +101,7 @@ class CheckoutsController < ApplicationController
101
101
  facet :reserved
102
102
  end
103
103
  page = params[:page] || 1
104
- search.query.paginate(page.to_i, Checkout.per_page)
104
+ search.query.paginate(page.to_i, Checkout.default_per_page)
105
105
  @checkouts = search.execute!.results
106
106
  @checkouts_facet = search.facet(:reserved).rows
107
107
  end
@@ -19,9 +19,9 @@ class ManifestationCheckoutStatsController < ApplicationController
19
19
  if params[:format] == 'csv'
20
20
  per_page = 65534
21
21
  else
22
- per_page = CheckoutStatHasManifestation.per_page
22
+ per_page = CheckoutStatHasManifestation.default_per_page
23
23
  end
24
- @stats = @manifestation_checkout_stat.checkout_stat_has_manifestations.order('checkouts_count DESC, manifestation_id').page(params[:page]).per_page(per_page)
24
+ @stats = @manifestation_checkout_stat.checkout_stat_has_manifestations.order('checkouts_count DESC, manifestation_id').page(params[:page]).per(per_page)
25
25
 
26
26
  respond_to do |format|
27
27
  format.html # show.html.erb
@@ -19,9 +19,9 @@ class ManifestationReserveStatsController < ApplicationController
19
19
  if params[:format] == 'csv'
20
20
  per_page = 65534
21
21
  else
22
- per_page = ReserveStatHasManifestation.per_page
22
+ per_page = ReserveStatHasManifestation.default_per_page
23
23
  end
24
- @stats = @manifestation_reserve_stat.reserve_stat_has_manifestations.order('reserves_count DESC, manifestation_id').page(params[:page]).per_page(per_page)
24
+ @stats = @manifestation_reserve_stat.reserve_stat_has_manifestations.order('reserves_count DESC, manifestation_id').page(params[:page]).per(per_page)
25
25
 
26
26
  respond_to do |format|
27
27
  format.html # show.html.erb
@@ -19,9 +19,9 @@ class UserCheckoutStatsController < ApplicationController
19
19
  if params[:format] == 'csv'
20
20
  per_page = 65534
21
21
  else
22
- per_page = CheckoutStatHasUser.per_page
22
+ per_page = CheckoutStatHasUser.default_per_page
23
23
  end
24
- @stats = @user_checkout_stat.checkout_stat_has_users.order('checkouts_count DESC, user_id').page(params[:page]).per_page(per_page)
24
+ @stats = @user_checkout_stat.checkout_stat_has_users.order('checkouts_count DESC, user_id').page(params[:page]).per(per_page)
25
25
 
26
26
  respond_to do |format|
27
27
  format.html # show.html.erb
@@ -19,9 +19,9 @@ class UserReserveStatsController < ApplicationController
19
19
  if params[:format] == 'csv'
20
20
  per_page = 65534
21
21
  else
22
- per_page = ReserveStatHasUser.per_page
22
+ per_page = ReserveStatHasUser.default_per_page
23
23
  end
24
- @stats = @user_reserve_stat.reserve_stat_has_users.order('reserves_count DESC, user_id').page(params[:page]).per_page(per_page)
24
+ @stats = @user_reserve_stat.reserve_stat_has_users.order('reserves_count DESC, user_id').page(params[:page]).per(per_page)
25
25
 
26
26
  respond_to do |format|
27
27
  format.html # show.html.erb
@@ -13,9 +13,7 @@ class Checkin < ActiveRecord::Base
13
13
 
14
14
  attr_accessor :item_identifier
15
15
 
16
- def self.per_page
17
- 10
18
- end
16
+ paginates_per 10
19
17
 
20
18
  def available_for_checkin?
21
19
  if item.blank?
@@ -43,9 +43,7 @@ class Checkout < ActiveRecord::Base
43
43
  end
44
44
  end
45
45
 
46
- def self.per_page
47
- 10
48
- end
46
+ paginates_per 10
49
47
 
50
48
  def is_not_checked?
51
49
  checkout = Checkout.not_returned.where(:item_id => item_id)
@@ -8,9 +8,7 @@ class CheckoutStatHasManifestation < ActiveRecord::Base
8
8
  validates_uniqueness_of :manifestation_id, :scope => :manifestation_checkout_stat_id
9
9
  validates_presence_of :manifestation_checkout_stat_id, :manifestation_id
10
10
 
11
- def self.per_page
12
- 10
13
- end
11
+ paginates_per 10
14
12
  end
15
13
 
16
14
  # == Schema Information
@@ -8,9 +8,7 @@ class CheckoutStatHasUser < ActiveRecord::Base
8
8
  validates_uniqueness_of :user_id, :scope => :user_checkout_stat_id
9
9
  validates_presence_of :user_checkout_stat_id, :user_id
10
10
 
11
- def self.per_page
12
- 10
13
- end
11
+ paginates_per 10
14
12
  end
15
13
 
16
14
  # == Schema Information
@@ -13,9 +13,7 @@ class CheckoutType < ActiveRecord::Base
13
13
  #has_many :items, :through => :item_has_checkout_types
14
14
  has_many :items
15
15
 
16
- def self.per_page
17
- 10
18
- end
16
+ paginates_per 10
19
17
  end
20
18
 
21
19
  # == Schema Information
@@ -8,9 +8,7 @@ class ItemHasUseRestriction < ActiveRecord::Base
8
8
  validates_presence_of :use_restriction
9
9
  validates_presence_of :item, :on => :update
10
10
 
11
- def self.per_page
12
- 10
13
- end
11
+ paginates_per 10
14
12
  end
15
13
 
16
14
  # == Schema Information
@@ -9,9 +9,7 @@ class LendingPolicy < ActiveRecord::Base
9
9
  validates_uniqueness_of :user_group_id, :scope => :item_id
10
10
  validates_date :fixed_due_date, :allow_blank => true
11
11
 
12
- def self.per_page
13
- 10
14
- end
12
+ paginates_per 10
15
13
 
16
14
  acts_as_list :scope => :item_id
17
15
  end
@@ -13,9 +13,7 @@ class ManifestationCheckoutStat < ActiveRecord::Base
13
13
  end
14
14
  end
15
15
 
16
- def self.per_page
17
- 10
18
- end
16
+ paginates_per 10
19
17
 
20
18
  def calculate_count
21
19
  self.started_at = Time.zone.now
@@ -13,9 +13,7 @@ class ManifestationReserveStat < ActiveRecord::Base
13
13
  end
14
14
  end
15
15
 
16
- def self.per_page
17
- 10
18
- end
16
+ paginates_per 10
19
17
 
20
18
  def calculate_count
21
19
  self.started_at = Time.zone.now
@@ -71,9 +71,7 @@ class Reserve < ActiveRecord::Base
71
71
  end
72
72
  end
73
73
 
74
- def self.per_page
75
- 10
76
- end
74
+ paginates_per 10
77
75
 
78
76
  def set_item_and_manifestation
79
77
  item = Item.where(:item_identifier => item_identifier).first
@@ -174,7 +172,8 @@ class Reserve < ActiveRecord::Base
174
172
  request.assign_attributes({:sender => sender, :receiver => sender, :message_template => message_template_to_library}, :as => :admin)
175
173
  request.save_message_body(:manifestations => options[:manifestations])
176
174
  self.not_sent_expiration_notice_to_library.each do |reserve|
177
- reserve.update_attribute(:expiration_notice_to_library, true)
175
+ reserve.expiration_notice_to_library = true
176
+ reserve.save(:validate => false)
178
177
  end
179
178
  #when 'canceled'
180
179
  # message_template_to_library = MessageTemplate.localized_template('reservation_canceled_for_library', sender.locale)
@@ -8,9 +8,7 @@ class ReserveStatHasManifestation < ActiveRecord::Base
8
8
  validates_uniqueness_of :manifestation_id, :scope => :manifestation_reserve_stat_id
9
9
  validates_presence_of :manifestation_reserve_stat_id, :manifestation_id
10
10
 
11
- def self.per_page
12
- 10
13
- end
11
+ paginates_per 10
14
12
  end
15
13
 
16
14
  # == Schema Information
@@ -8,9 +8,7 @@ class ReserveStatHasUser < ActiveRecord::Base
8
8
  validates_uniqueness_of :user_id, :scope => :user_reserve_stat_id
9
9
  validates_presence_of :user_reserve_stat_id, :user_id
10
10
 
11
- def self.per_page
12
- 10
13
- end
11
+ paginates_per 10
14
12
  end
15
13
 
16
14
  # == Schema Information
@@ -13,9 +13,7 @@ class UserCheckoutStat < ActiveRecord::Base
13
13
  end
14
14
  end
15
15
 
16
- def self.per_page
17
- 10
18
- end
16
+ paginates_per 10
19
17
 
20
18
  def calculate_count
21
19
  self.started_at = Time.zone.now
@@ -13,9 +13,7 @@ class UserReserveStat < ActiveRecord::Base
13
13
  end
14
14
  end
15
15
 
16
- def self.per_page
17
- 10
18
- end
16
+ paginates_per 10
19
17
 
20
18
  def calculate_count
21
19
  self.started_at = Time.zone.now
@@ -19,7 +19,7 @@
19
19
  <%- end -%>
20
20
  </table>
21
21
 
22
- <%= will_paginate(@baskets) -%>
22
+ <%= paginate(@baskets) -%>
23
23
 
24
24
  </div>
25
25
  </div>
@@ -2,7 +2,7 @@
2
2
  <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.checked_item')) -%></h1>
3
3
  <div id="content_list">
4
4
  <%= render 'checked_item' %>
5
- <%= will_paginate @checked_items %>
5
+ <%= paginate @checked_items %>
6
6
  </div>
7
7
  </div>
8
8
 
@@ -2,7 +2,7 @@
2
2
  <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.checkin')) -%></h1>
3
3
  <div id="content_list">
4
4
  <%= render 'checkin' %>
5
- <%= will_paginate @checkins %>
5
+ <%= paginate @checkins %>
6
6
  </div>
7
7
  </div>
8
8
 
@@ -21,7 +21,7 @@
21
21
  <%- end -%>
22
22
  </table>
23
23
 
24
- <%= will_paginate(@checkout_stat_has_manifestations) -%>
24
+ <%= paginate(@checkout_stat_has_manifestations) -%>
25
25
 
26
26
  </div>
27
27
  </div>
@@ -21,7 +21,7 @@
21
21
  <%- end -%>
22
22
  </table>
23
23
 
24
- <%= will_paginate(@checkout_stat_has_users) -%>
24
+ <%= paginate(@checkout_stat_has_users) -%>
25
25
 
26
26
  </div>
27
27
  </div>
@@ -35,7 +35,7 @@
35
35
  <%- end -%>
36
36
  </table>
37
37
 
38
- <%= will_paginate(@checkout_types) -%>
38
+ <%= paginate(@checkout_types) -%>
39
39
  </div>
40
40
  </div>
41
41
 
@@ -42,4 +42,4 @@
42
42
  <%- end -%>
43
43
  </table>
44
44
 
45
- <%= will_paginate(@checkouts) %>
45
+ <%= paginate(@checkouts) %>
@@ -21,7 +21,7 @@
21
21
  <%- end -%>
22
22
  </table>
23
23
 
24
- <%= will_paginate(@item_has_use_restrictions) -%>
24
+ <%= paginate(@item_has_use_restrictions) -%>
25
25
  <br />
26
26
 
27
27
  <%- if @item -%>
@@ -33,7 +33,7 @@
33
33
  <%- end -%>
34
34
  </table>
35
35
 
36
- <%= will_paginate(@lending_policies) -%>
36
+ <%= paginate(@lending_policies) -%>
37
37
 
38
38
  </div>
39
39
  </div>
@@ -24,7 +24,7 @@
24
24
  <%- end -%>
25
25
  </table>
26
26
 
27
- <%= will_paginate(@manifestation_checkout_stats) -%>
27
+ <%= paginate(@manifestation_checkout_stats) -%>
28
28
  </div>
29
29
  </div>
30
30
 
@@ -38,7 +38,7 @@
38
38
  <%- end -%>
39
39
  </table>
40
40
 
41
- <%= will_paginate(@stats) -%>
41
+ <%= paginate(@stats) -%>
42
42
 
43
43
  </div>
44
44
  </div>
@@ -24,7 +24,7 @@
24
24
  <%- end -%>
25
25
  </table>
26
26
 
27
- <%= will_paginate(@manifestation_reserve_stats) -%>
27
+ <%= paginate(@manifestation_reserve_stats) -%>
28
28
  </div>
29
29
  </div>
30
30
 
@@ -38,7 +38,7 @@
38
38
  <%- end -%>
39
39
  </table>
40
40
 
41
- <%= will_paginate(@stats) -%>
41
+ <%= paginate(@stats) -%>
42
42
 
43
43
  </div>
44
44
  </div>
@@ -21,7 +21,7 @@
21
21
  <%- end -%>
22
22
  </table>
23
23
 
24
- <%= will_paginate(@reserve_stat_has_manifestations) -%>
24
+ <%= paginate(@reserve_stat_has_manifestations) -%>
25
25
 
26
26
  </div>
27
27
  </div>
@@ -21,7 +21,7 @@
21
21
  <%- end -%>
22
22
  </table>
23
23
 
24
- <%= will_paginate(@reserve_stat_has_users) -%>
24
+ <%= paginate(@reserve_stat_has_users) -%>
25
25
 
26
26
  </div>
27
27
  </div>
@@ -39,7 +39,7 @@
39
39
  <%- end -%>
40
40
  </table>
41
41
 
42
- <%= will_paginate(@reserves) -%>
42
+ <%= paginate(@reserves) -%>
43
43
 
44
44
  </div>
45
45
  </div>
@@ -24,7 +24,7 @@
24
24
  <%- end -%>
25
25
  </table>
26
26
 
27
- <%= will_paginate(@user_checkout_stats) -%>
27
+ <%= paginate(@user_checkout_stats) -%>
28
28
  </div>
29
29
  </div>
30
30
 
@@ -38,7 +38,7 @@
38
38
  <%- end -%>
39
39
  </table>
40
40
 
41
- <%= will_paginate(@stats) -%>
41
+ <%= paginate(@stats) -%>
42
42
 
43
43
  </div>
44
44
  </div>
@@ -24,7 +24,7 @@
24
24
  <%- end -%>
25
25
  </table>
26
26
 
27
- <%= will_paginate(@user_reserve_stats) -%>
27
+ <%= paginate(@user_reserve_stats) -%>
28
28
  </div>
29
29
  </div>
30
30
 
@@ -38,7 +38,7 @@
38
38
  <%- end -%>
39
39
  </table>
40
40
 
41
- <%= will_paginate(@stats) -%>
41
+ <%= paginate(@stats) -%>
42
42
  </div>
43
43
  </div>
44
44
 
@@ -13,10 +13,6 @@ module EnjuCirculation
13
13
  module InstanceMethods
14
14
  private
15
15
 
16
- def get_basket
17
- @basket = Basket.find(params[:basket_id]) if params[:basket_id]
18
- end
19
-
20
16
  def get_checkout_type
21
17
  @checkout_type = CheckoutType.find(params[:checkout_type_id]) if params[:checkout_type_id]
22
18
  end
@@ -1,3 +1,3 @@
1
1
  module EnjuCirculation
2
- VERSION = "0.0.71"
2
+ VERSION = "0.1.0.pre"
3
3
  end
@@ -0,0 +1,38 @@
1
+ module EnjuCirculation
2
+ module Generators
3
+ class ViewsGenerator < Rails::Generators::Base
4
+ source_root File.expand_path('../../../../app/views', __FILE__)
5
+
6
+ def copy_files
7
+ directories = %w(
8
+ baskets
9
+ carrier_type_has_checkout_types
10
+ checked_items
11
+ checkins
12
+ checkout_stat_has_manifestations
13
+ checkout_stat_has_users
14
+ checkout_types
15
+ checkouts
16
+ circulation_statuses
17
+ item_has_use_restrictions
18
+ lending_policies
19
+ manifestation_checkout_stats
20
+ manifestation_reserve_stats
21
+ my_accounts
22
+ reserve_stat_has_manifestations
23
+ reserve_stat_has_users
24
+ reserves
25
+ use_restrictions
26
+ user_checkout_stats
27
+ user_group_has_checkout_types
28
+ user_reserve_stats
29
+ users
30
+ )
31
+
32
+ directories.each do |dir|
33
+ directory dir, "app/views/#{dir}"
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -4,12 +4,13 @@ class Notifier < ActionMailer::Base
4
4
  default_url_options[:host] = uri.host
5
5
  default_url_options[:port] = uri.port if configatron.enju.web_port_number != 80
6
6
  else
7
- default_url_options[:host] = configatron.enju.web_hostname
8
- default_url_options[:port] = configatron.enju.web_port_number if configatron.enju.web_port_number != 80
7
+ default_url_options[:host] = 'library.example.jp'
8
+ default_url_options[:port] = 80
9
9
  end
10
10
 
11
- def message_notification(message)
12
- I18n.locale = message.receiver.locale.to_sym
11
+ def message_notification(message_id)
12
+ message = Message.find(message_id)
13
+ I18n.locale = message.receiver.locale.try(:to_sym) || I18n.default_locale
13
14
  from = "#{LibraryGroup.system_name(message.receiver.locale)} <#{LibraryGroup.site_config.email}>"
14
15
  if message.subject
15
16
  subject = message.subject
@@ -5,7 +5,6 @@ class Ability
5
5
  case user.try(:role).try(:name)
6
6
  when 'Administrator'
7
7
  can :manage, [
8
- Accept,
9
8
  Basket,
10
9
  CarrierTypeHasCheckoutType,
11
10
  CheckedItem,
@@ -43,7 +42,6 @@ class Ability
43
42
  end
44
43
  when 'Librarian'
45
44
  can :manage, [
46
- Accept,
47
45
  Basket,
48
46
  CheckedItem,
49
47
  Checkin,
@@ -0,0 +1,13 @@
1
+ class LocalPatron
2
+ def initialize(user)
3
+ @user = user
4
+ end
5
+
6
+ def id
7
+ end
8
+
9
+ def full_name
10
+ # TODO: 外部サービスから取得
11
+ @user.email
12
+ end
13
+ end
@@ -46,4 +46,12 @@ class User < ActiveRecord::Base
46
46
  end
47
47
  end
48
48
  end
49
+
50
+ def patron
51
+ LocalPatron.new(self)
52
+ end
53
+
54
+ def full_name
55
+ username
56
+ end
49
57
  end
@@ -54,4 +54,7 @@ module Dummy
54
54
  end
55
55
  end
56
56
 
57
- require 'enju_leaf'
57
+ require 'nkf'
58
+ require 'enju_biblio'
59
+ require 'enju_library'
60
+ require 'enju_manifestation_viewer'
@@ -13,17 +13,6 @@
13
13
 
14
14
  ActiveRecord::Schema.define(:version => 20120424103932) do
15
15
 
16
- create_table "accepts", :force => true do |t|
17
- t.integer "basket_id"
18
- t.integer "item_id"
19
- t.integer "librarian_id"
20
- t.datetime "created_at", :null => false
21
- t.datetime "updated_at", :null => false
22
- end
23
-
24
- add_index "accepts", ["basket_id"], :name => "index_accepts_on_basket_id"
25
- add_index "accepts", ["item_id"], :name => "index_accepts_on_item_id"
26
-
27
16
  create_table "baskets", :force => true do |t|
28
17
  t.integer "user_id"
29
18
  t.text "note"
Binary file