enju_library 0.1.0.pre43 → 0.1.0.pre44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/accepts_controller.rb +2 -2
- data/app/controllers/withdraws_controller.rb +126 -0
- data/app/models/accept.rb +2 -3
- data/app/models/basket.rb +3 -3
- data/app/models/bookstore.rb +6 -7
- data/app/models/budget_type.rb +3 -4
- data/app/models/color.rb +4 -4
- data/app/models/enju_library/ability.rb +4 -2
- data/app/models/library.rb +11 -12
- data/app/models/library_group.rb +6 -5
- data/app/models/request_status_type.rb +3 -4
- data/app/models/request_type.rb +3 -4
- data/app/models/search_engine.rb +4 -5
- data/app/models/shelf.rb +3 -4
- data/app/models/subscribe.rb +2 -3
- data/app/models/subscription.rb +2 -3
- data/app/models/withdraw.rb +27 -0
- data/app/views/accepts/new.html.erb +1 -1
- data/app/views/libraries/show.html.erb +21 -17
- data/app/views/library_groups/_form.html.erb +5 -0
- data/app/views/library_groups/show.html.erb +9 -4
- data/app/views/withdraws/_form.html.erb +11 -0
- data/app/views/withdraws/_list.html.erb +31 -0
- data/app/views/withdraws/edit.html.erb +13 -0
- data/app/views/withdraws/index.html.erb +50 -0
- data/app/views/withdraws/index.js.erb +1 -0
- data/app/views/withdraws/index.txt.csv +4 -0
- data/app/views/withdraws/new.html.erb +15 -0
- data/app/views/withdraws/show.html.erb +31 -0
- data/config/locales/translation_en.yml +11 -0
- data/config/locales/translation_ja.yml +11 -0
- data/config/routes.rb +3 -2
- data/db/migrate/20150924115059_create_withdraws.rb +13 -0
- data/lib/enju_library/version.rb +1 -1
- data/spec/controllers/accepts_controller_spec.rb +3 -3
- data/spec/controllers/withdraws_controller_spec.rb +132 -0
- data/spec/dummy/app/assets/javascripts/application.js +4 -6
- data/spec/dummy/db/schema.rb +12 -1
- data/spec/factories/accepts.rb +2 -2
- data/spec/factories/budget_types.rb +3 -3
- data/spec/factories/withdraw.rb +21 -0
- data/spec/fixtures/baskets.yml +2 -3
- data/spec/fixtures/bookstores.yml +6 -7
- data/spec/fixtures/budget_types.yml +3 -4
- data/spec/fixtures/colors.yml +4 -4
- data/spec/fixtures/libraries.yml +10 -10
- data/spec/fixtures/library_groups.yml +7 -5
- data/spec/fixtures/request_status_types.yml +3 -3
- data/spec/fixtures/request_types.yml +3 -3
- data/spec/fixtures/search_engines.yml +4 -5
- data/spec/fixtures/shelves.yml +3 -3
- data/spec/fixtures/subscribes.yml +2 -3
- data/spec/fixtures/subscriptions.yml +2 -3
- data/spec/fixtures/withdraws.yml +20 -0
- data/spec/models/accept_spec.rb +2 -3
- data/spec/models/basket_spec.rb +2 -3
- data/spec/models/bookstore_spec.rb +6 -7
- data/spec/models/budget_type_spec.rb +3 -4
- data/spec/models/library_group_spec.rb +6 -5
- data/spec/models/library_spec.rb +10 -11
- data/spec/models/request_status_type_spec.rb +3 -4
- data/spec/models/request_type_spec.rb +3 -4
- data/spec/models/search_engine_spec.rb +4 -5
- data/spec/models/shelf_spec.rb +3 -4
- data/spec/models/subscribe_spec.rb +2 -3
- data/spec/models/subscription_spec.rb +2 -3
- data/spec/models/withdraw_spec.rb +21 -0
- data/spec/rails_helper.rb +79 -0
- data/spec/routing/withdraws_routing_spec.rb +27 -0
- data/spec/spec_helper.rb +82 -51
- data/spec/views/libraries/show.html.erb_spec.rb +14 -0
- data/spec/views/withdraws/edit.html.erb_spec.rb +14 -0
- data/spec/views/withdraws/index.html.erb_spec.rb +26 -0
- data/spec/views/withdraws/new.html.erb_spec.rb +31 -0
- data/spec/views/withdraws/show.html.erb_spec.rb +11 -0
- metadata +43 -26
- data/spec/support/vcr.rb +0 -9
@@ -0,0 +1,50 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
|
+
<h1 class="title"><%= t('page.listing', model: t('activerecord.models.withdraw')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
|
5
|
+
<div class="search_form">
|
6
|
+
<%= form_for(:withdraw, html: {method: :get}) do |f| %>
|
7
|
+
<p>
|
8
|
+
<%= label_tag :item_identifier, t('activerecord.attributes.item.item_identifier') -%>:
|
9
|
+
<%= f.search_field :item_identifier, value: @query, class: 'resource_item_identifier' -%>
|
10
|
+
<%= f.submit t('page.search') -%>
|
11
|
+
</p>
|
12
|
+
<%- end -%>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<table class="table table-striped index">
|
16
|
+
<tr>
|
17
|
+
<th><%= t('activerecord.models.item') -%></th>
|
18
|
+
<th></th>
|
19
|
+
</tr>
|
20
|
+
<%- @withdraws.each_with_index do |withdraw, i| -%>
|
21
|
+
<tr class="line<%= cycle("0", "1") -%>">
|
22
|
+
<td>
|
23
|
+
<% if withdraw.item %>
|
24
|
+
<%= render 'manifestations/show_index', manifestation: withdraw.item.manifestation %>
|
25
|
+
<%= link_to withdraw.item.item_identifier, withdraw.item -%> / <%= withdraw.item.call_number %>
|
26
|
+
(<%= link_to withdraw.item.shelf.library.display_name.localize, withdraw.item.shelf.library %> /
|
27
|
+
<%= link_to withdraw.item.shelf.display_name.localize, withdraw.item.shelf %>)<br />
|
28
|
+
<%=l withdraw.created_at %>
|
29
|
+
<% end %>
|
30
|
+
</td>
|
31
|
+
<td>
|
32
|
+
<%- if can? :delete, withdraw -%>
|
33
|
+
<%= link_to t('page.destroy'), withdraw, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
34
|
+
<%- end -%>
|
35
|
+
</td>
|
36
|
+
</tr>
|
37
|
+
<%- end -%>
|
38
|
+
</table>
|
39
|
+
<%= javascript_tag("$(function(){$('#withdraw_item_identifier').focus()})") %>
|
40
|
+
|
41
|
+
<%= paginate(@withdraws) %>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="submenu" class="ui-corner-all ui-widget-content">
|
46
|
+
<ul>
|
47
|
+
<li><%= link_to t('page.new', model: t('activerecord.models.withdraw')), new_withdraw_path -%></li>
|
48
|
+
<li><%= link_to t('page.listing', model: t('activerecord.attributes.withdraw.removed_items', status: CirculationStatus.where(name: 'Removed').first.display_name.localize) + t('activerecord.models.item')), items_path(circulation_status: 'Removed') -%></li>
|
49
|
+
</ul>
|
50
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
$("#withdraw_list").html("<%= escape_javascript(render('withdraws/list')) %>");
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
|
+
<h1 class="title"><%= t('page.new', model: t('activerecord.models.withdraw')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
<div id="withdraw_list">
|
5
|
+
<%= render 'list' -%>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div id="submenu" class="ui-corner-all ui-widget-content">
|
11
|
+
<ul>
|
12
|
+
<li><%= link_to t('page.listing', model: t('activerecord.models.withdraw')), withdraws_path -%></li>
|
13
|
+
<li><%= link_to t('page.listing', model: t('activerecord.attributes.withdraw.removed_items', status: CirculationStatus.where(name: 'Removed').first.display_name.localize) + t('activerecord.models.item')), items_path(circulation_status: 'Removed') -%></li>
|
14
|
+
</ul>
|
15
|
+
</div>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
|
+
<h1 class="title"><%= t('page.showing', model: t('activerecord.models.withdraw')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
5
|
+
|
6
|
+
<p>
|
7
|
+
<strong><%= t('activerecord.models.item') -%>:</strong>
|
8
|
+
<% if @withdraw.item %>
|
9
|
+
<%= link_to @withdraw.item.item_identifier, @withdraw.item -%>
|
10
|
+
(<%= link_to @withdraw.item.manifestation.original_title, @withdraw.item.manifestation %>)
|
11
|
+
<% end %>
|
12
|
+
</p>
|
13
|
+
|
14
|
+
<p>
|
15
|
+
<strong><%= t('activerecord.models.user') -%>:</strong>
|
16
|
+
<%= link_to @withdraw.librarian.username, @withdraw.librarian.profile if @withdraw.librarian.try(:profile) -%>
|
17
|
+
</p>
|
18
|
+
|
19
|
+
<p>
|
20
|
+
<strong><%= t('page.created_at') -%>:</strong>
|
21
|
+
<%=l @withdraw.created_at %>
|
22
|
+
</p>
|
23
|
+
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div id="submenu" class="ui-corner-all ui-widget-content">
|
28
|
+
<ul>
|
29
|
+
<li><%= back_to_index(flash[:page_info]) -%></li>
|
30
|
+
</ul>
|
31
|
+
</div>
|
@@ -12,6 +12,7 @@ en:
|
|
12
12
|
request_status_type: Request status type
|
13
13
|
request_type: Request type
|
14
14
|
search_engine: Search engine
|
15
|
+
withdraw: Bulk Withdraw
|
15
16
|
|
16
17
|
attributes:
|
17
18
|
library:
|
@@ -55,6 +56,7 @@ en:
|
|
55
56
|
url: URL
|
56
57
|
color: Color
|
57
58
|
max_number_of_results: Max number of results
|
59
|
+
book_jacket_source: Book jacket source
|
58
60
|
bookstore:
|
59
61
|
name: Name
|
60
62
|
zip_code: Zip code
|
@@ -98,6 +100,9 @@ en:
|
|
98
100
|
additional_param: Additional param
|
99
101
|
note: Note
|
100
102
|
position: Position
|
103
|
+
withdraw:
|
104
|
+
item_id: Item
|
105
|
+
removed_items: "%{status} "
|
101
106
|
|
102
107
|
library:
|
103
108
|
map: "Map"
|
@@ -114,3 +119,9 @@ en:
|
|
114
119
|
already_accepted: " is already accepted."
|
115
120
|
accept: "Accept!"
|
116
121
|
successfully_accepted: "This items was successfully accepted."
|
122
|
+
withdraw:
|
123
|
+
item_not_found: " not found."
|
124
|
+
enter_item_identifier: "Enter item identifier."
|
125
|
+
already_withdrawn: " is already withdrawn."
|
126
|
+
withdraw: "Withdraw!"
|
127
|
+
successfully_withdrawn: "This items was successfully withdrawn."
|
@@ -12,6 +12,7 @@ ja:
|
|
12
12
|
request_status_type: 依頼の状態の種類
|
13
13
|
request_type: 依頼の種類
|
14
14
|
search_engine: 検索エンジン
|
15
|
+
withdraw: 連続除籍
|
15
16
|
|
16
17
|
attributes:
|
17
18
|
library:
|
@@ -55,6 +56,7 @@ ja:
|
|
55
56
|
url: URL
|
56
57
|
color: 色
|
57
58
|
max_number_of_results: 検索結果の最大件数
|
59
|
+
book_jacket_source: 書影の取得元
|
58
60
|
bookstore:
|
59
61
|
name: 名前
|
60
62
|
zip_code: 郵便番号
|
@@ -98,6 +100,9 @@ ja:
|
|
98
100
|
additional_param: 追加のパラメータ
|
99
101
|
note: 注記
|
100
102
|
position: 位置
|
103
|
+
withdraw:
|
104
|
+
item_id: 個別資料
|
105
|
+
removed_items: "%{status}の"
|
101
106
|
|
102
107
|
library:
|
103
108
|
map: "地図"
|
@@ -114,3 +119,9 @@ ja:
|
|
114
119
|
already_accepted: "はすでに検収されています。"
|
115
120
|
accept: "検収"
|
116
121
|
successfully_accepted: "この資料は正常に検収されました。"
|
122
|
+
withdraw:
|
123
|
+
item_not_found: "が見つかりません。"
|
124
|
+
enter_item_identifier: "所蔵情報番号を入力してください。"
|
125
|
+
already_withdrawn: "はすでに除籍されています。"
|
126
|
+
withdraw: "除籍"
|
127
|
+
successfully_withdrawn: "この資料は正常に除籍されました。"
|
data/config/routes.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
Rails.application.routes.draw do
|
2
|
+
resources :withdraws, except: [:edit, :update]
|
2
3
|
resources :libraries
|
3
4
|
resources :shelves
|
4
5
|
|
5
6
|
resources :baskets
|
6
|
-
resources :accepts, :
|
7
|
+
resources :accepts, except: [:edit, :update]
|
7
8
|
|
8
9
|
resources :bookstores
|
9
|
-
resources :library_groups, :
|
10
|
+
resources :library_groups, except: [:new, :create, :destroy]
|
10
11
|
resources :subscriptions
|
11
12
|
resources :subscribes
|
12
13
|
resources :search_engines
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateWithdraws < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :withdraws do |t|
|
4
|
+
t.integer :basket_id
|
5
|
+
t.integer :item_id
|
6
|
+
t.integer :librarian_id
|
7
|
+
|
8
|
+
t.timestamps null: false
|
9
|
+
end
|
10
|
+
add_index :withdraws, :basket_id
|
11
|
+
add_index :withdraws, :item_id
|
12
|
+
end
|
13
|
+
end
|
data/lib/enju_library/version.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rails_helper'
|
2
2
|
|
3
3
|
describe AcceptsController do
|
4
4
|
fixtures :all
|
@@ -22,7 +22,7 @@ describe AcceptsController do
|
|
22
22
|
describe "When basket_id is specified" do
|
23
23
|
it "assigns all accepts as @accepts" do
|
24
24
|
get :index, :basket_id => 10
|
25
|
-
assigns(:accepts).should eq
|
25
|
+
assigns(:accepts).should eq baskets(:basket_00010).accepts.order('accepts.created_at DESC').page(1)
|
26
26
|
response.should be_success
|
27
27
|
end
|
28
28
|
end
|
@@ -40,7 +40,7 @@ describe AcceptsController do
|
|
40
40
|
describe "When basket_id is specified" do
|
41
41
|
it "assigns all accepts as @accepts" do
|
42
42
|
get :index, :basket_id => 9
|
43
|
-
assigns(:accepts).should eq
|
43
|
+
assigns(:accepts).should eq baskets(:basket_00009).accepts.order('accepts.created_at DESC').page(1)
|
44
44
|
response.should be_success
|
45
45
|
end
|
46
46
|
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
# This spec was generated by rspec-rails when you ran the scaffold generator.
|
4
|
+
# It demonstrates how one might use RSpec to specify the controller code that
|
5
|
+
# was generated by Rails when you ran the scaffold generator.
|
6
|
+
#
|
7
|
+
# It assumes that the implementation code is generated by the rails scaffold
|
8
|
+
# generator. If you are using any extension libraries to generate different
|
9
|
+
# controller code, this generated spec may or may not pass.
|
10
|
+
#
|
11
|
+
# It only uses APIs available in rails and/or rspec-rails. There are a number
|
12
|
+
# of tools you can use to make these specs even more expressive, but we're
|
13
|
+
# sticking to rails and rspec-rails APIs to keep things simple and stable.
|
14
|
+
#
|
15
|
+
# Compared to earlier versions of this generator, there is very limited use of
|
16
|
+
# stubs and message expectations in this spec. Stubs are only used when there
|
17
|
+
# is no simpler way to get a handle on the object needed for the example.
|
18
|
+
# Message expectations are only used when there is no simpler way to specify
|
19
|
+
# that an instance is receiving a specific message.
|
20
|
+
|
21
|
+
RSpec.describe WithdrawsController, type: :controller do
|
22
|
+
fixtures :all
|
23
|
+
|
24
|
+
# This should return the minimal set of attributes required to create a valid
|
25
|
+
# Withdraw. As you add validations to Withdraw, be sure to
|
26
|
+
# adjust the attributes here as well.
|
27
|
+
let(:valid_attributes) {
|
28
|
+
FactoryGirl.build(:withdraw).attributes.with_indifferent_access
|
29
|
+
}
|
30
|
+
let(:invalid_attributes) {
|
31
|
+
{ item_id: nil }
|
32
|
+
}
|
33
|
+
let(:valid_create_attributes) {
|
34
|
+
{ basket_id: Basket.find(valid_attributes[:basket_id]).id,
|
35
|
+
withdraw: { item_identifier: Item.find(valid_attributes[:item_id]).item_identifier }
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
# This should return the minimal set of values that should be in the session
|
40
|
+
# in order to pass any filters (e.g. authentication) defined in
|
41
|
+
# WithdrawsController. Be sure to keep this updated too.
|
42
|
+
let(:valid_session) { {} }
|
43
|
+
|
44
|
+
describe "GET #index" do
|
45
|
+
describe "When logged in as Administrator" do
|
46
|
+
login_fixture_admin
|
47
|
+
it "assigns all withdraws as @withdraws" do
|
48
|
+
withdraw = Withdraw.create! valid_attributes
|
49
|
+
get :index, :basket_id => 1
|
50
|
+
expect(assigns(:withdraws)).to eq baskets(:basket_00001).withdraws.order('withdraws.created_at DESC').page(1)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "GET #show" do
|
56
|
+
describe "When logged in as Administrator" do
|
57
|
+
login_fixture_admin
|
58
|
+
it "assigns the requested withdraw as @withdraw" do
|
59
|
+
withdraw = Withdraw.create! valid_attributes
|
60
|
+
get :show, {:id => withdraw.to_param}
|
61
|
+
expect(assigns(:withdraw)).to eq(withdraw)
|
62
|
+
response.should be_success
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
describe "GET #new" do
|
68
|
+
describe "When logged in as Administrator" do
|
69
|
+
login_fixture_admin
|
70
|
+
it "assigns a new withdraw as @withdraw" do
|
71
|
+
get :new, {}
|
72
|
+
expect(assigns(:withdraw)).to be_a_new(Withdraw)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
describe "POST #create" do
|
78
|
+
describe "When logged in as Administrator" do
|
79
|
+
login_fixture_admin
|
80
|
+
context "with valid params" do
|
81
|
+
it "creates a new Withdraw" do
|
82
|
+
expect {
|
83
|
+
post :create, valid_create_attributes
|
84
|
+
}.to change(Withdraw, :count).by(1)
|
85
|
+
expect(assigns(:withdraw)).to be_persisted
|
86
|
+
end
|
87
|
+
|
88
|
+
it "assigns a newly created withdraw as @withdraw" do
|
89
|
+
post :create, valid_create_attributes
|
90
|
+
expect(assigns(:withdraw)).to be_a(Withdraw)
|
91
|
+
expect(assigns(:withdraw)).to be_persisted
|
92
|
+
end
|
93
|
+
|
94
|
+
it "redirects to the created withdraw" do
|
95
|
+
post :create, valid_create_attributes
|
96
|
+
expect(response).to redirect_to(withdraws_path(basket_id: valid_create_attributes[:basket_id]))
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
context "with invalid params" do
|
101
|
+
it "assigns a newly created but unsaved withdraw as @withdraw" do
|
102
|
+
post :create, {:basket_id => valid_create_attributes[:basket_id], :withdraw => {item_id: nil}}
|
103
|
+
expect(assigns(:withdraw)).to be_a_new(Withdraw)
|
104
|
+
end
|
105
|
+
|
106
|
+
it "re-renders the 'new' template" do
|
107
|
+
post :create, {:basket_id => valid_create_attributes[:basket_id], :withdraw => {item_id: nil}}
|
108
|
+
expect(response).to render_template("index")
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
describe "DELETE #destroy" do
|
115
|
+
describe "When logged in as Administrator" do
|
116
|
+
login_fixture_admin
|
117
|
+
it "destroys the requested withdraw" do
|
118
|
+
withdraw = Withdraw.create! valid_attributes
|
119
|
+
expect {
|
120
|
+
delete :destroy, {:id => withdraw.to_param}
|
121
|
+
}.to change(Withdraw, :count).by(-1)
|
122
|
+
end
|
123
|
+
|
124
|
+
it "redirects to the withdraws list" do
|
125
|
+
withdraw = Withdraw.create! valid_attributes
|
126
|
+
delete :destroy, {:id => withdraw.to_param}
|
127
|
+
expect(response).to redirect_to(withdraws_url)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
end
|
@@ -2,14 +2,12 @@
|
|
2
2
|
// listed below.
|
3
3
|
//
|
4
4
|
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or vendor/assets/javascripts
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
6
|
//
|
7
7
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
//
|
8
|
+
// compiled file.
|
9
9
|
//
|
10
|
-
//
|
11
|
-
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
12
|
//
|
13
|
-
//= require jquery
|
14
|
-
//= require jquery_ujs
|
15
13
|
//= require_tree .
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20150924115059) do
|
15
15
|
|
16
16
|
create_table "accepts", force: :cascade do |t|
|
17
17
|
t.integer "basket_id"
|
@@ -1466,4 +1466,15 @@ ActiveRecord::Schema.define(version: 20150221063719) do
|
|
1466
1466
|
|
1467
1467
|
add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
|
1468
1468
|
|
1469
|
+
create_table "withdraws", force: :cascade do |t|
|
1470
|
+
t.integer "basket_id"
|
1471
|
+
t.integer "item_id"
|
1472
|
+
t.integer "librarian_id"
|
1473
|
+
t.datetime "created_at", null: false
|
1474
|
+
t.datetime "updated_at", null: false
|
1475
|
+
end
|
1476
|
+
|
1477
|
+
add_index "withdraws", ["basket_id"], name: "index_withdraws_on_basket_id"
|
1478
|
+
add_index "withdraws", ["item_id"], name: "index_withdraws_on_item_id"
|
1479
|
+
|
1469
1480
|
end
|
data/spec/factories/accepts.rb
CHANGED
@@ -9,10 +9,10 @@ end
|
|
9
9
|
# Table name: budget_types
|
10
10
|
#
|
11
11
|
# id :integer not null, primary key
|
12
|
-
# name :string
|
12
|
+
# name :string
|
13
13
|
# display_name :text
|
14
14
|
# note :text
|
15
15
|
# position :integer
|
16
|
-
# created_at :datetime
|
17
|
-
# updated_at :datetime
|
16
|
+
# created_at :datetime
|
17
|
+
# updated_at :datetime
|
18
18
|
#
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Read about factories at https://github.com/thoughtbot/factory_girl
|
2
|
+
|
3
|
+
FactoryGirl.define do
|
4
|
+
factory :withdraw do
|
5
|
+
item_id{FactoryGirl.create(:item).id}
|
6
|
+
librarian_id{FactoryGirl.create(:librarian).id}
|
7
|
+
basket_id{FactoryGirl.create(:basket, user_id: librarian_id).id}
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
# == Schema Information
|
12
|
+
#
|
13
|
+
# Table name: withdraws
|
14
|
+
#
|
15
|
+
# id :integer not null, primary key
|
16
|
+
# basket_id :integer
|
17
|
+
# item_id :integer
|
18
|
+
# librarian_id :integer
|
19
|
+
# created_at :datetime not null
|
20
|
+
# updated_at :datetime not null
|
21
|
+
#
|
data/spec/fixtures/baskets.yml
CHANGED
@@ -93,15 +93,14 @@ bookstore_00007:
|
|
93
93
|
#
|
94
94
|
# id :integer not null, primary key
|
95
95
|
# name :text not null
|
96
|
-
# zip_code :string
|
96
|
+
# zip_code :string
|
97
97
|
# address :text
|
98
98
|
# note :text
|
99
|
-
# telephone_number :string
|
100
|
-
# fax_number :string
|
101
|
-
# url :string
|
99
|
+
# telephone_number :string
|
100
|
+
# fax_number :string
|
101
|
+
# url :string
|
102
102
|
# position :integer
|
103
103
|
# deleted_at :datetime
|
104
|
-
# created_at :datetime
|
105
|
-
# updated_at :datetime
|
104
|
+
# created_at :datetime
|
105
|
+
# updated_at :datetime
|
106
106
|
#
|
107
|
-
|
@@ -19,11 +19,10 @@ donation:
|
|
19
19
|
# Table name: budget_types
|
20
20
|
#
|
21
21
|
# id :integer not null, primary key
|
22
|
-
# name :string
|
22
|
+
# name :string
|
23
23
|
# display_name :text
|
24
24
|
# note :text
|
25
25
|
# position :integer
|
26
|
-
# created_at :datetime
|
27
|
-
# updated_at :datetime
|
26
|
+
# created_at :datetime
|
27
|
+
# updated_at :datetime
|
28
28
|
#
|
29
|
-
|
data/spec/fixtures/colors.yml
CHANGED
@@ -30,9 +30,9 @@ color_00004:
|
|
30
30
|
#
|
31
31
|
# id :integer not null, primary key
|
32
32
|
# library_group_id :integer
|
33
|
-
# property :string
|
34
|
-
# code :string
|
33
|
+
# property :string
|
34
|
+
# code :string
|
35
35
|
# position :integer
|
36
|
-
# created_at :datetime
|
37
|
-
# updated_at :datetime
|
36
|
+
# created_at :datetime
|
37
|
+
# updated_at :datetime
|
38
38
|
#
|
data/spec/fixtures/libraries.yml
CHANGED
@@ -74,28 +74,28 @@ library_00004:
|
|
74
74
|
# Table name: libraries
|
75
75
|
#
|
76
76
|
# id :integer not null, primary key
|
77
|
-
# name :string
|
77
|
+
# name :string not null
|
78
78
|
# display_name :text
|
79
|
-
# short_display_name :string
|
80
|
-
# zip_code :string
|
79
|
+
# short_display_name :string not null
|
80
|
+
# zip_code :string
|
81
81
|
# street :text
|
82
82
|
# locality :text
|
83
83
|
# region :text
|
84
|
-
# telephone_number_1 :string
|
85
|
-
# telephone_number_2 :string
|
86
|
-
# fax_number :string
|
84
|
+
# telephone_number_1 :string
|
85
|
+
# telephone_number_2 :string
|
86
|
+
# fax_number :string
|
87
87
|
# note :text
|
88
88
|
# call_number_rows :integer default(1), not null
|
89
|
-
# call_number_delimiter :string
|
89
|
+
# call_number_delimiter :string default("|"), not null
|
90
90
|
# library_group_id :integer default(1), not null
|
91
91
|
# users_count :integer default(0), not null
|
92
92
|
# position :integer
|
93
93
|
# country_id :integer
|
94
|
-
# created_at :datetime
|
95
|
-
# updated_at :datetime
|
94
|
+
# created_at :datetime
|
95
|
+
# updated_at :datetime
|
96
96
|
# deleted_at :datetime
|
97
97
|
# opening_hour :text
|
98
|
-
# isil :string
|
98
|
+
# isil :string
|
99
99
|
# latitude :float
|
100
100
|
# longitude :float
|
101
101
|
#
|
@@ -17,21 +17,23 @@ one:
|
|
17
17
|
<% else %>
|
18
18
|
"---\n:max_number_of_results: 200\n:family_name_first: true\n"
|
19
19
|
<% end %>
|
20
|
+
|
20
21
|
# == Schema Information
|
21
22
|
#
|
22
23
|
# Table name: library_groups
|
23
24
|
#
|
24
25
|
# id :integer not null, primary key
|
25
|
-
# name :string
|
26
|
+
# name :string not null
|
26
27
|
# display_name :text
|
27
|
-
# short_name :string
|
28
|
+
# short_name :string not null
|
28
29
|
# my_networks :text
|
29
30
|
# login_banner :text
|
30
31
|
# note :text
|
31
32
|
# country_id :integer
|
32
33
|
# position :integer
|
33
|
-
# created_at :datetime
|
34
|
-
# updated_at :datetime
|
34
|
+
# created_at :datetime
|
35
|
+
# updated_at :datetime
|
35
36
|
# admin_networks :text
|
36
|
-
# url :string
|
37
|
+
# url :string default("http://localhost:3000/")
|
38
|
+
# settings :text
|
37
39
|
#
|
@@ -53,10 +53,10 @@ request_status_type_00006:
|
|
53
53
|
# Table name: request_status_types
|
54
54
|
#
|
55
55
|
# id :integer not null, primary key
|
56
|
-
# name :string
|
56
|
+
# name :string not null
|
57
57
|
# display_name :text
|
58
58
|
# note :text
|
59
59
|
# position :integer
|
60
|
-
# created_at :datetime
|
61
|
-
# updated_at :datetime
|
60
|
+
# created_at :datetime
|
61
|
+
# updated_at :datetime
|
62
62
|
#
|
@@ -45,10 +45,10 @@ request_type_00004:
|
|
45
45
|
# Table name: request_types
|
46
46
|
#
|
47
47
|
# id :integer not null, primary key
|
48
|
-
# name :string
|
48
|
+
# name :string not null
|
49
49
|
# display_name :text
|
50
50
|
# note :text
|
51
51
|
# position :integer
|
52
|
-
# created_at :datetime
|
53
|
-
# updated_at :datetime
|
52
|
+
# created_at :datetime
|
53
|
+
# updated_at :datetime
|
54
54
|
#
|
@@ -26,16 +26,15 @@ search_engine_00002:
|
|
26
26
|
# Table name: search_engines
|
27
27
|
#
|
28
28
|
# id :integer not null, primary key
|
29
|
-
# name :string
|
29
|
+
# name :string not null
|
30
30
|
# display_name :text
|
31
|
-
# url :string
|
31
|
+
# url :string not null
|
32
32
|
# base_url :text not null
|
33
33
|
# http_method :text not null
|
34
34
|
# query_param :text not null
|
35
35
|
# additional_param :text
|
36
36
|
# note :text
|
37
37
|
# position :integer
|
38
|
-
# created_at :datetime
|
39
|
-
# updated_at :datetime
|
38
|
+
# created_at :datetime
|
39
|
+
# updated_at :datetime
|
40
40
|
#
|
41
|
-
|