enju_flower 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.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/app/views/manifestations/_manifestation.html.erb +8 -4
  3. data/app/views/manifestations/_pickup.html.erb +1 -1
  4. data/app/views/manifestations/_show_detail_librarian.html.erb +1 -1
  5. data/app/views/manifestations/_show_detail_user.html.erb +2 -2
  6. data/app/views/manifestations/_show_holding.html.erb +6 -1
  7. data/app/views/manifestations/_show_reservation.html.erb +0 -2
  8. data/app/views/manifestations/_title.html.erb +1 -1
  9. data/app/views/manifestations/_title.mobile.erb +1 -1
  10. data/app/views/manifestations/index.html.erb +2 -2
  11. data/app/views/manifestations/index.sru.builder +1 -1
  12. data/app/views/manifestations/show.html.erb +3 -3
  13. data/lib/enju_flower/version.rb +1 -1
  14. data/spec/controllers/manifestations_controller_spec.rb +4 -4
  15. data/spec/dummy/app/models/user.rb +1 -0
  16. data/spec/dummy/config/application.rb +1 -0
  17. data/spec/dummy/config/initializers/inflections.rb +8 -0
  18. data/spec/dummy/db/migrate/035_create_reserves.rb +1 -1
  19. data/spec/dummy/db/migrate/20130303104849_add_state_index_to_reserve.rb +5 -0
  20. data/spec/dummy/db/migrate/20130303124821_add_retained_at_to_reserve.rb +5 -0
  21. data/spec/dummy/db/migrate/20130304015019_add_postponed_at_to_reserve.rb +5 -0
  22. data/spec/dummy/db/migrate/20130519065638_add_lock_version_to_reserve.rb +5 -0
  23. data/spec/dummy/db/migrate/20130519065837_add_lock_version_to_checkin.rb +5 -0
  24. data/spec/dummy/db/migrate/20140518050147_create_reserve_transitions.rb +14 -0
  25. data/spec/dummy/db/migrate/20140528045518_create_user_checkout_stat_transitions.rb +14 -0
  26. data/spec/dummy/db/migrate/20140528045539_create_user_reserve_stat_transitions.rb +14 -0
  27. data/spec/dummy/db/migrate/20140528045600_create_manifestation_checkout_stat_transitions.rb +14 -0
  28. data/spec/dummy/db/migrate/20140528045617_create_manifestation_reserve_stat_transitions.rb +14 -0
  29. data/spec/dummy/db/migrate/20140529014410_create_item_transitions.rb +14 -0
  30. data/spec/dummy/db/schema.rb +82 -5
  31. data/spec/dummy/db/test.sqlite3 +0 -0
  32. data/spec/dummy/solr/default/data/index/_cx.fdt +0 -0
  33. data/spec/dummy/solr/default/data/index/{_96.fnm → _cx.fnm} +0 -0
  34. data/spec/dummy/solr/default/data/index/{_96.si → _cx.si} +0 -0
  35. data/spec/dummy/solr/default/data/index/{_96_Lucene41_0.doc → _cx_Lucene41_0.doc} +0 -0
  36. data/spec/dummy/solr/default/data/index/{_96_Lucene41_0.pos → _cx_Lucene41_0.pos} +0 -0
  37. data/spec/dummy/solr/default/data/index/{_96_Lucene41_0.tim → _cx_Lucene41_0.tim} +0 -0
  38. data/spec/dummy/solr/default/data/index/_cx_Lucene41_0.tip +0 -0
  39. data/spec/dummy/solr/default/data/index/_cy.fdt +0 -0
  40. data/spec/dummy/solr/default/data/index/{_97.fnm → _cy.fnm} +0 -0
  41. data/spec/dummy/solr/default/data/index/{_97.si → _cy.si} +0 -0
  42. data/spec/dummy/solr/default/data/index/{_97_Lucene41_0.doc → _cy_Lucene41_0.doc} +0 -0
  43. data/spec/dummy/solr/default/data/index/{_97_Lucene41_0.pos → _cy_Lucene41_0.pos} +0 -0
  44. data/spec/dummy/solr/default/data/index/{_97_Lucene41_0.tim → _cy_Lucene41_0.tim} +0 -0
  45. data/spec/dummy/solr/default/data/index/_cy_Lucene41_0.tip +0 -0
  46. data/spec/dummy/solr/default/data/index/_cz.fdt +0 -0
  47. data/spec/dummy/solr/default/data/index/{_98.fnm → _cz.fnm} +0 -0
  48. data/spec/dummy/solr/default/data/index/_cz.nvd +0 -0
  49. data/spec/dummy/solr/default/data/index/{_98.si → _cz.si} +0 -0
  50. data/spec/dummy/solr/default/data/index/_cz_Lucene41_0.doc +0 -0
  51. data/spec/dummy/solr/default/data/index/_cz_Lucene41_0.pos +0 -0
  52. data/spec/dummy/solr/default/data/index/_cz_Lucene41_0.tim +0 -0
  53. data/spec/dummy/solr/default/data/index/_cz_Lucene41_0.tip +0 -0
  54. data/spec/dummy/solr/default/data/index/segments.gen +0 -0
  55. data/spec/dummy/solr/default/data/index/segments_gj +0 -0
  56. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000591 +0 -0
  57. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000592 +0 -0
  58. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000593 +0 -0
  59. data/spec/dummy/tmp/cache/4F7/F90/default_role +0 -0
  60. data/spec/dummy/tmp/cache/6E4/420/search_engine_all +0 -0
  61. data/spec/spec_helper.rb +3 -0
  62. metadata +126 -80
  63. data/spec/dummy/app/models/local_agent.rb +0 -27
  64. data/spec/dummy/solr/default/data/index/_96.fdt +0 -0
  65. data/spec/dummy/solr/default/data/index/_96_Lucene41_0.tip +0 -0
  66. data/spec/dummy/solr/default/data/index/_97.fdt +0 -0
  67. data/spec/dummy/solr/default/data/index/_97_Lucene41_0.tip +0 -0
  68. data/spec/dummy/solr/default/data/index/_98.fdt +0 -0
  69. data/spec/dummy/solr/default/data/index/_98.nvd +0 -0
  70. data/spec/dummy/solr/default/data/index/_98_Lucene41_0.doc +0 -0
  71. data/spec/dummy/solr/default/data/index/_98_Lucene41_0.pos +0 -0
  72. data/spec/dummy/solr/default/data/index/_98_Lucene41_0.tim +0 -0
  73. data/spec/dummy/solr/default/data/index/_98_Lucene41_0.tip +0 -0
  74. data/spec/dummy/solr/default/data/index/segments_bn +0 -0
  75. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000415 +0 -0
  76. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000416 +0 -0
  77. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000417 +0 -0
  78. data/vendor/assets/javascripts/jquery.mobile-1.3.1.js +0 -11191
  79. data/vendor/assets/stylesheets/jquery.mobile-1.3.1.css +0 -3366
  80. /data/spec/dummy/solr/default/data/index/{_96.fdx → _cx.fdx} +0 -0
  81. /data/spec/dummy/solr/default/data/index/{_96.nvd → _cx.nvd} +0 -0
  82. /data/spec/dummy/solr/default/data/index/{_96.nvm → _cx.nvm} +0 -0
  83. /data/spec/dummy/solr/default/data/index/{_97.fdx → _cy.fdx} +0 -0
  84. /data/spec/dummy/solr/default/data/index/{_97.nvd → _cy.nvd} +0 -0
  85. /data/spec/dummy/solr/default/data/index/{_97.nvm → _cy.nvm} +0 -0
  86. /data/spec/dummy/solr/default/data/index/{_98.fdx → _cz.fdx} +0 -0
  87. /data/spec/dummy/solr/default/data/index/{_98.nvm → _cz.nvm} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2823668d0878e6623fae70d25f01341ae9ab62f0
4
- data.tar.gz: 2737e4bc2de2affd0d11c6e2417cdd55475ce204
3
+ metadata.gz: 1bde6cb170d186ff7704b504b226d11add963357
4
+ data.tar.gz: a3d1d54f28bb280616c7a293b366c3dc66b43209
5
5
  SHA512:
6
- metadata.gz: 4973b1fb214f1cc2163344be3e3f7f4746d7644915a8ba08493c2c32f94e8e6caf00c03857aa87a3018b9cb06fcf86335ca38a28d40d174bb69630bbd1077173
7
- data.tar.gz: 7495ac070988b200e24b3bc6bd1acf24b9f373460da64fafcbabdd4b3c7a877095e1ae09300c0bd150f8cbb3ba68ebe4d2837e0adb4f901ccd37c656389bb180
6
+ metadata.gz: 1f79043997dcb5b7fd870b0c212c7cb3cd03e01885c141feeec76d8a2d2a16e0ae07d8d1dda311c9a2956d694bbd0a06310fe6479c0ec87656fb216fbddb7274
7
+ data.tar.gz: 09fc6adab782515eea1e76c5e8dfbbb2036eb82cfe880a1443fb3b298f2bf6aeee82cf80ae8247780b5d07bcd4ddb014f9810b9bad9e189148e747db83eb6ebd
@@ -1,7 +1,6 @@
1
1
  <tr class="line<%= cycle("0", "1") -%>">
2
2
  <td style="width: 30px"><%= @manifestations.offset_value + 1 + manifestation_counter -%></td>
3
3
  <td style="480px">
4
- <% cache([:manifestation => manifestation.id, :fragment => 'manifestation_html', :role => current_user_role_name, :locale => @locale]) do %>
5
4
  <% if manifestation.root_series_statement %>
6
5
  <%= render 'manifestations/show_series_index', :manifestation => manifestation, :series_statement => manifestation.root_series_statement -%>
7
6
  <% else %>
@@ -9,8 +8,14 @@
9
8
  <div class="access_address">
10
9
  <%= link_to manifestation.access_address, manifestation.access_address if manifestation.access_address.present? -%>
11
10
  </div>
12
- <%- unless manifestation.items.on_shelf.empty? -%>
13
- (<%= link_to_function t('page.holding'), "$('#holding_#{manifestation.id}').toggle()" -%>)
11
+ <% if current_user.try(:has_role?, 'Librarian') %>
12
+ <%- unless manifestation.items.on_shelf.empty? -%>
13
+ (<%= link_to_function t('page.holding'), "$('#holding_#{manifestation.id}').toggle()" -%>)
14
+ <% end %>
15
+ <% else %>
16
+ <%- unless manifestation.items.for_checkout.on_shelf.empty? -%>
17
+ (<%= link_to_function t('page.holding'), "$('#holding_#{manifestation.id}').toggle()" -%>)
18
+ <%- end -%>
14
19
  <%- end -%>
15
20
  <% if defined?(EnjuBookmark) %>
16
21
  <%- if manifestation.tags.first -%>
@@ -20,7 +25,6 @@
20
25
  <% end %>
21
26
  <% end %>
22
27
  <%= render 'manifestations/holding', :manifestation => manifestation -%>
23
- <% end %>
24
28
  </td>
25
29
  <% if signed_in? %>
26
30
  <td id="edit_icons">
@@ -1,5 +1,5 @@
1
1
  <% if manifestation %>
2
- <% cache([:manifestation => manifestation.id, :fragment => 'pickup_html', :role => current_user_role_name, :locale => @locale]) do %>
2
+ <% cache(:manifestation => manifestation.id, :fragment => 'pickup_html', :role => current_user_role_name, :locale => @locale) do %>
3
3
  <div id="pickup_book_jacket">
4
4
  <%= book_jacket(manifestation) -%>
5
5
  </div>
@@ -1,7 +1,7 @@
1
1
  <div id="tabs">
2
2
  <%= render 'manifestations/tab_menu', :manifestation => manifestation %>
3
3
  <div id="detail">
4
- <% cache([:manifestation => manifestation.id, :fragment => 'show_detail_librarian_html', :role => current_user_role_name, :locale => @locale]) do %>
4
+ <% cache(:manifestation => manifestation.id, :fragment => 'show_detail_librarian_html', :role => current_user_role_name, :locale => @locale) do %>
5
5
  <table class="table table-striped" id="resource_detail">
6
6
  <%= embed_content(manifestation) -%>
7
7
  <% if manifestation.title_alternative? %>
@@ -1,7 +1,7 @@
1
1
  <div id="tabs">
2
2
  <%= render 'manifestations/tab_menu', :manifestation => manifestation %>
3
3
  <div id="detail">
4
- <% cache([:manifestation => manifestation.id, :fragment => 'show_detail_user_html', :role => current_user_role_name, :locale => @locale]) do %>
4
+ <% cache(:manifestation => manifestation.id, :fragment => 'show_detail_user_html', :role => current_user_role_name, :locale => @locale) do %>
5
5
  <table class="table table-striped" id="resource_detail">
6
6
  <%= embed_content(manifestation) -%>
7
7
  <% if manifestation.title_alternative? %>
@@ -103,7 +103,7 @@
103
103
  <% end %>
104
104
  </table>
105
105
  <% end %>
106
- <%- if manifestation.items.on_shelf.exists? -%>
106
+ <%- if manifestation.items.for_checkout.on_shelf.exists? -%>
107
107
  <%= render 'manifestations/show_holding', :manifestation => manifestation -%>
108
108
  <%- end -%>
109
109
  </div>
@@ -9,7 +9,12 @@
9
9
  <th><%= t('activerecord.models.circulation_status') -%></th>
10
10
  <% end %>
11
11
  </tr>
12
- <%- manifestation.items.on_shelf.each do |item| -%>
12
+ <% if current_user.try(:has_role?, 'Librarian') %>
13
+ <% items = manifestation.items.on_shelf %>
14
+ <% else %>
15
+ <% items = manifestation.items.for_checkout.on_shelf %>
16
+ <% end %>
17
+ <%- items.each do |item| -%>
13
18
  <tr>
14
19
  <td>
15
20
  <%- if item.item_identifier? -%>
@@ -9,7 +9,6 @@
9
9
  <% end %>
10
10
  <br />
11
11
  <% end %>
12
- <% cache([current_user_role_name, @locale, manifestation]) do %>
13
12
  <%- if can? :update, manifestation -%>
14
13
  <% unless params[:mode] == 'add' %>
15
14
  <%= link_to image_tag('icons/book_edit.png', :size => '16x16', :alt => t('page.edit')), edit_manifestation_path(manifestation) -%>
@@ -24,4 +23,3 @@
24
23
  <% end %>
25
24
  <%- end -%>
26
25
  <% end %>
27
- <% end %>
@@ -1,4 +1,4 @@
1
- <% cache([:manifestation => manifestation.id, :fragment => 'title_html', :role => current_user_role_name, :locale => @locale]) do %>
1
+ <% cache(:manifestation => manifestation.id, :fragment => 'title_html', :role => current_user_role_name, :locale => @locale) do %>
2
2
  <h2 class="resource_title">
3
3
  [M]
4
4
  <%= link_to title_with_volume_number(manifestation), manifestation, :itemprop => 'name' -%>
@@ -1,4 +1,4 @@
1
- <% cache([:manifestation => manifestation.id, :fragment => 'title_mobile', :role => current_user_role_name, :locale => @locale]) do %>
1
+ <% cache(:manifestation => manifestation.id, :fragment => 'title_mobile', :role => current_user_role_name, :locale => @locale) do %>
2
2
  <h2 class="resource_title">
3
3
  [M]
4
4
  <%= link_to title_with_volume_number(manifestation), manifestation, :itemprop => 'name' -%>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.search_resource', :model => t('page.resource')) -%></h1>
3
3
  <div id="content_list">
4
4
  <%= render 'manifestations/title', :manifestation => @manifestation if @manifestation -%>
@@ -74,7 +74,7 @@
74
74
  </div>
75
75
  </div>
76
76
 
77
- <div id="submenu" class="ui-corner-all">
77
+ <div id="submenu" class="ui-corner-all ui-widget-content">
78
78
  <% if @parent and can?(:update, @parent) %>
79
79
  <%= render 'submenu_parent' %>
80
80
  <% end %>
@@ -69,7 +69,7 @@ def get_record(manifestation)
69
69
  'xmlns:srw_dc' => "info:srw/schema/1/dc-v1.1",
70
70
  'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance",
71
71
  'xsi:schemaLocation' => "info:srw/schema/1/dc-v1.1 http://www.loc.gov/standards/sru/dc-schema.xsd" do
72
- cache([:manifestation => manifestation.id, :fragment => 'index_sru', :role => current_user_role_name, :locale => @locale]) do
72
+ cache(:manifestation => manifestation.id, :fragment => 'index_sru', :role => current_user_role_name, :locale => @locale) do
73
73
  xml.tag! 'dc:title', manifestation.original_title
74
74
  manifestation.creators.readable_by(current_user).each do |agent|
75
75
  xml.tag! 'dc:creator', agent.full_name
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all" itemscope="itemscope" itemtype="http://schema.org/Book">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content" itemscope="itemscope" itemtype="http://schema.org/Book">
2
2
  <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.manifestation')) -%></h1>
3
3
  <div id="content_list">
4
4
  <p id="notice"><%= notice %></p>
@@ -16,7 +16,7 @@
16
16
  </div>
17
17
  </div>
18
18
 
19
- <div id="submenu" class="ui-corner-all">
19
+ <div id="submenu" class="ui-corner-all ui-widget-content">
20
20
  <%= render 'manifestations/book_jacket', :manifestation => @manifestation -%>
21
21
  <ul>
22
22
  <%- if @manifestation.picture_files.exists? -%>
@@ -34,7 +34,7 @@
34
34
  </script>
35
35
  <%- if user_signed_in? -%>
36
36
  <div id="call_number_content">
37
- <%- @manifestation.items.on_shelf.each do |item| -%>
37
+ <%- @manifestation.items.for_checkout.on_shelf.each do |item| -%>
38
38
  <%- if item.hold?(current_user.library) -%>
39
39
  <%= call_number_label(item) -%>
40
40
  <%- end -%>
@@ -1,3 +1,3 @@
1
1
  module EnjuFlower
2
- VERSION = "0.1.0.pre15"
2
+ VERSION = "0.1.0.pre16"
3
3
  end
@@ -139,14 +139,14 @@ describe ManifestationsController do
139
139
  it "should get index with pub_date_from" do
140
140
  get :index, :query => '2005', :pub_date_from => '2000'
141
141
  response.should be_success
142
- assigns(:manifestations).should be_true
142
+ assigns(:manifestations).should be_truthy
143
143
  assigns(:query).should eq '2005 date_of_publication_d:[1999-12-31T15:00:00Z TO *]'
144
144
  end
145
145
 
146
146
  it "should get index with pub_date_to" do
147
147
  get :index, :query => '2005', :pub_date_to => '2000'
148
148
  response.should be_success
149
- assigns(:manifestations).should be_true
149
+ assigns(:manifestations).should be_truthy
150
150
  assigns(:query).should eq '2005 date_of_publication_d:[* TO 2000-12-31T14:59:59Z]'
151
151
  end
152
152
 
@@ -389,7 +389,7 @@ describe ManifestationsController do
389
389
  it "assigns a series_statement" do
390
390
  post :create, :manifestation => @attrs.merge(:series_statements_attributes => {[0] => {:original_title => SeriesStatement.find(1).original_title}})
391
391
  assigns(:manifestation).reload
392
- assigns(:manifestation).series_statements.pluck(:original_title).include?(series_statements(:one).original_title).should be_true
392
+ assigns(:manifestation).series_statements.pluck(:original_title).include?(series_statements(:one).original_title).should be_truthy
393
393
  end
394
394
 
395
395
  it "redirects to the created manifestation" do
@@ -513,7 +513,7 @@ describe ManifestationsController do
513
513
  it "assigns a series_statement" do
514
514
  put :update, :id => @manifestation.id, :manifestation => @attrs.merge(:series_statements_attributes => {[0] => {:original_title => series_statements(:two).original_title, "_destroy"=>"false"}})
515
515
  assigns(:manifestation).reload
516
- assigns(:manifestation).series_statements.pluck(:original_title).include?(series_statements(:two).original_title).should be_true
516
+ assigns(:manifestation).series_statements.pluck(:original_title).include?(series_statements(:two).original_title).should be_truthy
517
517
  end
518
518
 
519
519
  it "assigns the requested manifestation as @manifestation" do
@@ -5,4 +5,5 @@ class User < ActiveRecord::Base
5
5
  :lockable, :lock_strategy => :none, :unlock_strategy => :none
6
6
 
7
7
  enju_leaf_user_model
8
+ enju_circulation_user_model
8
9
  end
@@ -58,4 +58,5 @@ module Dummy
58
58
  end
59
59
 
60
60
  require 'enju_leaf'
61
+ require 'enju_circulation'
61
62
  require 'enju_bookmark'
@@ -8,3 +8,11 @@
8
8
  # inflect.irregular 'person', 'people'
9
9
  # inflect.uncountable %w( fish sheep )
10
10
  # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
16
+ ActiveSupport::Inflector.inflections do |inflect|
17
+ inflect.irregular 'reserve', 'reserves'
18
+ end
@@ -11,7 +11,7 @@ class CreateReserves < ActiveRecord::Migration
11
11
  t.datetime :expired_at
12
12
  t.datetime :deleted_at
13
13
  t.string :state
14
- t.boolean :expiration_notice_to_agent, :default => false
14
+ t.boolean :expiration_notice_to_patron, :default => false
15
15
  t.boolean :expiration_notice_to_library, :default => false
16
16
  end
17
17
 
@@ -0,0 +1,5 @@
1
+ class AddStateIndexToReserve < ActiveRecord::Migration
2
+ def change
3
+ add_index :reserves, :state
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddRetainedAtToReserve < ActiveRecord::Migration
2
+ def change
3
+ add_column :reserves, :retained_at, :datetime
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddPostponedAtToReserve < ActiveRecord::Migration
2
+ def change
3
+ add_column :reserves, :postponed_at, :datetime
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddLockVersionToReserve < ActiveRecord::Migration
2
+ def change
3
+ add_column :reserves, :lock_version, :integer, :default => 0, :null => false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddLockVersionToCheckin < ActiveRecord::Migration
2
+ def change
3
+ add_column :checkins, :lock_version, :integer, :default => 0, :null => false
4
+ end
5
+ end
@@ -0,0 +1,14 @@
1
+ class CreateReserveTransitions < ActiveRecord::Migration
2
+ def change
3
+ create_table :reserve_transitions do |t|
4
+ t.string :to_state
5
+ t.text :metadata, default: "{}"
6
+ t.integer :sort_key
7
+ t.integer :reserve_id
8
+ t.timestamps
9
+ end
10
+
11
+ add_index :reserve_transitions, :reserve_id
12
+ add_index :reserve_transitions, [:sort_key, :reserve_id], unique: true
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ class CreateUserCheckoutStatTransitions < ActiveRecord::Migration
2
+ def change
3
+ create_table :user_checkout_stat_transitions do |t|
4
+ t.string :to_state
5
+ t.text :metadata, default: "{}"
6
+ t.integer :sort_key
7
+ t.integer :user_checkout_stat_id
8
+ t.timestamps
9
+ end
10
+
11
+ add_index :user_checkout_stat_transitions, :user_checkout_stat_id
12
+ add_index :user_checkout_stat_transitions, [:sort_key, :user_checkout_stat_id], unique: true, name: "index_user_checkout_stat_transitions_on_sort_key_and_stat_id"
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ class CreateUserReserveStatTransitions < ActiveRecord::Migration
2
+ def change
3
+ create_table :user_reserve_stat_transitions do |t|
4
+ t.string :to_state
5
+ t.text :metadata, default: "{}"
6
+ t.integer :sort_key
7
+ t.integer :user_reserve_stat_id
8
+ t.timestamps
9
+ end
10
+
11
+ add_index :user_reserve_stat_transitions, :user_reserve_stat_id
12
+ add_index :user_reserve_stat_transitions, [:sort_key, :user_reserve_stat_id], unique: true, name: "index_user_reserve_stat_transitions_on_sort_key_and_stat_id"
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ class CreateManifestationCheckoutStatTransitions < ActiveRecord::Migration
2
+ def change
3
+ create_table :manifestation_checkout_stat_transitions do |t|
4
+ t.string :to_state
5
+ t.text :metadata, default: "{}"
6
+ t.integer :sort_key
7
+ t.integer :manifestation_checkout_stat_id
8
+ t.timestamps
9
+ end
10
+
11
+ add_index :manifestation_checkout_stat_transitions, :manifestation_checkout_stat_id, name: "index_manifestation_checkout_stat_transitions_on_stat_id"
12
+ add_index :manifestation_checkout_stat_transitions, [:sort_key, :manifestation_checkout_stat_id], unique: true, name: "index_manifestation_checkout_stat_transitions_on_transition"
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ class CreateManifestationReserveStatTransitions < ActiveRecord::Migration
2
+ def change
3
+ create_table :manifestation_reserve_stat_transitions do |t|
4
+ t.string :to_state
5
+ t.text :metadata, default: "{}"
6
+ t.integer :sort_key
7
+ t.integer :manifestation_reserve_stat_id
8
+ t.timestamps
9
+ end
10
+
11
+ add_index :manifestation_reserve_stat_transitions, :manifestation_reserve_stat_id, name: "index_manifestation_reserve_stat_transitions_on_stat_id"
12
+ add_index :manifestation_reserve_stat_transitions, [:sort_key, :manifestation_reserve_stat_id], unique: true, name: "index_manifestation_reserve_stat_transitions_on_transition"
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ class CreateItemTransitions < ActiveRecord::Migration
2
+ def change
3
+ create_table :item_transitions do |t|
4
+ t.string :to_state
5
+ t.text :metadata, default: "{}"
6
+ t.integer :sort_key
7
+ t.integer :item_id
8
+ t.timestamps
9
+ end
10
+
11
+ add_index :item_transitions, :item_id
12
+ add_index :item_transitions, [:sort_key, :item_id], unique: true
13
+ end
14
+ end
@@ -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 => 20130509185724) do
14
+ ActiveRecord::Schema.define(:version => 20140529014410) do
15
15
 
16
16
  create_table "agent_import_files", :force => true do |t|
17
17
  t.integer "parent_id"
@@ -238,11 +238,12 @@ ActiveRecord::Schema.define(:version => 20130509185724) do
238
238
  add_index "checked_items", ["item_id"], :name => "index_checked_items_on_item_id"
239
239
 
240
240
  create_table "checkins", :force => true do |t|
241
- t.integer "item_id", :null => false
241
+ t.integer "item_id", :null => false
242
242
  t.integer "librarian_id"
243
243
  t.integer "basket_id"
244
- t.datetime "created_at", :null => false
245
- t.datetime "updated_at", :null => false
244
+ t.datetime "created_at", :null => false
245
+ t.datetime "updated_at", :null => false
246
+ t.integer "lock_version", :default => 0, :null => false
246
247
  end
247
248
 
248
249
  add_index "checkins", ["basket_id"], :name => "index_checkins_on_basket_id"
@@ -550,6 +551,18 @@ ActiveRecord::Schema.define(:version => 20130509185724) do
550
551
  add_index "item_has_use_restrictions", ["item_id"], :name => "index_item_has_use_restrictions_on_item_id"
551
552
  add_index "item_has_use_restrictions", ["use_restriction_id"], :name => "index_item_has_use_restrictions_on_use_restriction_id"
552
553
 
554
+ create_table "item_transitions", :force => true do |t|
555
+ t.string "to_state"
556
+ t.text "metadata", :default => "{}"
557
+ t.integer "sort_key"
558
+ t.integer "item_id"
559
+ t.datetime "created_at", :null => false
560
+ t.datetime "updated_at", :null => false
561
+ end
562
+
563
+ add_index "item_transitions", ["item_id"], :name => "index_item_transitions_on_item_id"
564
+ add_index "item_transitions", ["sort_key", "item_id"], :name => "index_item_transitions_on_sort_key_and_item_id", :unique => true
565
+
553
566
  create_table "items", :force => true do |t|
554
567
  t.string "call_number"
555
568
  t.string "item_identifier"
@@ -665,6 +678,18 @@ ActiveRecord::Schema.define(:version => 20130509185724) do
665
678
  t.datetime "updated_at", :null => false
666
679
  end
667
680
 
681
+ create_table "manifestation_checkout_stat_transitions", :force => true do |t|
682
+ t.string "to_state"
683
+ t.text "metadata", :default => "{}"
684
+ t.integer "sort_key"
685
+ t.integer "manifestation_checkout_stat_id"
686
+ t.datetime "created_at", :null => false
687
+ t.datetime "updated_at", :null => false
688
+ end
689
+
690
+ add_index "manifestation_checkout_stat_transitions", ["manifestation_checkout_stat_id"], :name => "index_manifestation_checkout_stat_transitions_on_stat_id"
691
+ add_index "manifestation_checkout_stat_transitions", ["sort_key", "manifestation_checkout_stat_id"], :name => "index_manifestation_checkout_stat_transitions_on_transition", :unique => true
692
+
668
693
  create_table "manifestation_checkout_stats", :force => true do |t|
669
694
  t.datetime "start_date"
670
695
  t.datetime "end_date"
@@ -699,6 +724,18 @@ ActiveRecord::Schema.define(:version => 20130509185724) do
699
724
  add_index "manifestation_relationships", ["child_id"], :name => "index_manifestation_relationships_on_child_id"
700
725
  add_index "manifestation_relationships", ["parent_id"], :name => "index_manifestation_relationships_on_parent_id"
701
726
 
727
+ create_table "manifestation_reserve_stat_transitions", :force => true do |t|
728
+ t.string "to_state"
729
+ t.text "metadata", :default => "{}"
730
+ t.integer "sort_key"
731
+ t.integer "manifestation_reserve_stat_id"
732
+ t.datetime "created_at", :null => false
733
+ t.datetime "updated_at", :null => false
734
+ end
735
+
736
+ add_index "manifestation_reserve_stat_transitions", ["manifestation_reserve_stat_id"], :name => "index_manifestation_reserve_stat_transitions_on_stat_id"
737
+ add_index "manifestation_reserve_stat_transitions", ["sort_key", "manifestation_reserve_stat_id"], :name => "index_manifestation_reserve_stat_transitions_on_transition", :unique => true
738
+
702
739
  create_table "manifestation_reserve_stats", :force => true do |t|
703
740
  t.datetime "start_date"
704
741
  t.datetime "end_date"
@@ -970,6 +1007,18 @@ ActiveRecord::Schema.define(:version => 20130509185724) do
970
1007
  add_index "reserve_stat_has_users", ["user_id"], :name => "index_reserve_stat_has_users_on_user_id"
971
1008
  add_index "reserve_stat_has_users", ["user_reserve_stat_id"], :name => "index_reserve_stat_has_users_on_user_reserve_stat_id"
972
1009
 
1010
+ create_table "reserve_transitions", :force => true do |t|
1011
+ t.string "to_state"
1012
+ t.text "metadata", :default => "{}"
1013
+ t.integer "sort_key"
1014
+ t.integer "reserve_id"
1015
+ t.datetime "created_at", :null => false
1016
+ t.datetime "updated_at", :null => false
1017
+ end
1018
+
1019
+ add_index "reserve_transitions", ["reserve_id"], :name => "index_reserve_transitions_on_reserve_id"
1020
+ add_index "reserve_transitions", ["sort_key", "reserve_id"], :name => "index_reserve_transitions_on_sort_key_and_reserve_id", :unique => true
1021
+
973
1022
  create_table "reserves", :force => true do |t|
974
1023
  t.integer "user_id", :null => false
975
1024
  t.integer "manifestation_id", :null => false
@@ -982,13 +1031,17 @@ ActiveRecord::Schema.define(:version => 20130509185724) do
982
1031
  t.datetime "expired_at"
983
1032
  t.datetime "deleted_at"
984
1033
  t.string "state"
985
- t.boolean "expiration_notice_to_agent", :default => false
1034
+ t.boolean "expiration_notice_to_patron", :default => false
986
1035
  t.boolean "expiration_notice_to_library", :default => false
1036
+ t.datetime "retained_at"
1037
+ t.datetime "postponed_at"
1038
+ t.integer "lock_version", :default => 0, :null => false
987
1039
  end
988
1040
 
989
1041
  add_index "reserves", ["item_id"], :name => "index_reserves_on_item_id"
990
1042
  add_index "reserves", ["manifestation_id"], :name => "index_reserves_on_manifestation_id"
991
1043
  add_index "reserves", ["request_status_type_id"], :name => "index_reserves_on_request_status_type_id"
1044
+ add_index "reserves", ["state"], :name => "index_reserves_on_state"
992
1045
  add_index "reserves", ["user_id"], :name => "index_reserves_on_user_id"
993
1046
 
994
1047
  create_table "resource_import_files", :force => true do |t|
@@ -1140,6 +1193,18 @@ ActiveRecord::Schema.define(:version => 20130509185724) do
1140
1193
  t.datetime "updated_at", :null => false
1141
1194
  end
1142
1195
 
1196
+ create_table "user_checkout_stat_transitions", :force => true do |t|
1197
+ t.string "to_state"
1198
+ t.text "metadata", :default => "{}"
1199
+ t.integer "sort_key"
1200
+ t.integer "user_checkout_stat_id"
1201
+ t.datetime "created_at", :null => false
1202
+ t.datetime "updated_at", :null => false
1203
+ end
1204
+
1205
+ add_index "user_checkout_stat_transitions", ["sort_key", "user_checkout_stat_id"], :name => "index_user_checkout_stat_transitions_on_sort_key_and_stat_id", :unique => true
1206
+ add_index "user_checkout_stat_transitions", ["user_checkout_stat_id"], :name => "index_user_checkout_stat_transitions_on_user_checkout_stat_id"
1207
+
1143
1208
  create_table "user_checkout_stats", :force => true do |t|
1144
1209
  t.datetime "start_date"
1145
1210
  t.datetime "end_date"
@@ -1196,6 +1261,18 @@ ActiveRecord::Schema.define(:version => 20130509185724) do
1196
1261
  t.datetime "updated_at", :null => false
1197
1262
  end
1198
1263
 
1264
+ create_table "user_reserve_stat_transitions", :force => true do |t|
1265
+ t.string "to_state"
1266
+ t.text "metadata", :default => "{}"
1267
+ t.integer "sort_key"
1268
+ t.integer "user_reserve_stat_id"
1269
+ t.datetime "created_at", :null => false
1270
+ t.datetime "updated_at", :null => false
1271
+ end
1272
+
1273
+ add_index "user_reserve_stat_transitions", ["sort_key", "user_reserve_stat_id"], :name => "index_user_reserve_stat_transitions_on_sort_key_and_stat_id", :unique => true
1274
+ add_index "user_reserve_stat_transitions", ["user_reserve_stat_id"], :name => "index_user_reserve_stat_transitions_on_user_reserve_stat_id"
1275
+
1199
1276
  create_table "user_reserve_stats", :force => true do |t|
1200
1277
  t.datetime "start_date"
1201
1278
  t.datetime "end_date"
Binary file