enju_inventory 0.1.11.pre8 → 0.1.11.pre9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/inventories_controller.rb +1 -1
- data/lib/enju_inventory/engine.rb +1 -1
- data/lib/enju_inventory/version.rb +1 -1
- data/spec/dummy/app/controllers/application_controller.rb +2 -61
- data/spec/dummy/config/application.rb +1 -1
- data/spec/dummy/config/initializers/devise.rb +2 -0
- data/spec/dummy/db/migrate/080_create_library_groups.rb +18 -0
- data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +9 -0
- data/spec/dummy/db/schema.rb +18 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/fixtures/library_groups.yml +34 -0
- metadata +36 -54
- data/app/assets/javascripts/enju_inventory/application.js +0 -15
- data/app/assets/stylesheets/enju_inventory/application.css +0 -13
- data/app/helpers/enju_inventory/application_helper.rb +0 -4
- data/app/views/layouts/enju_inventory/application.html.erb +0 -14
- data/spec/dummy/app/models/item.rb +0 -20
- data/spec/dummy/app/models/role.rb +0 -5
- data/spec/dummy/app/models/user_has_role.rb +0 -4
- data/spec/dummy/db/development.sqlite3 +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c171753db8ecb3be2c070658826980b66c0007f1
|
4
|
+
data.tar.gz: 576651552771d8f1aede61f34a97557e9b13c458
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05ba8f8a4403845bc912ec991c0bacbd9ed47391811d02fbde6a8454a7aad9f663da20a434c87b836e6eda66f486b23ada4a9f0839f2aecaf38a6f808d8317eb
|
7
|
+
data.tar.gz: 78656c031e03d9883620bd4ec0d8087801e3cfcb4c130827e7d35383edb576202e84d54201cad577ceac901ff7ecdd221197d75440364dbbdaa6cd853681d81c
|
@@ -1,65 +1,6 @@
|
|
1
1
|
class ApplicationController < ActionController::Base
|
2
2
|
protect_from_forgery
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
before_filter :set_locale
|
8
|
-
|
9
|
-
private
|
10
|
-
def render_403
|
11
|
-
return if performed?
|
12
|
-
if user_signed_in?
|
13
|
-
respond_to do |format|
|
14
|
-
format.html {render :template => 'page/403', :status => 403}
|
15
|
-
format.mobile {render :template => 'page/403', :status => 403}
|
16
|
-
format.xml {render :template => 'page/403', :status => 403}
|
17
|
-
format.json
|
18
|
-
end
|
19
|
-
else
|
20
|
-
respond_to do |format|
|
21
|
-
format.html {redirect_to new_user_session_url}
|
22
|
-
format.mobile {redirect_to new_user_session_url}
|
23
|
-
format.xml {render :template => 'page/403', :status => 403}
|
24
|
-
format.json
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def render_404
|
30
|
-
return if performed?
|
31
|
-
respond_to do |format|
|
32
|
-
format.html {render :template => 'page/404', :status => 404}
|
33
|
-
format.mobile {render :template => 'page/404', :status => 404}
|
34
|
-
format.xml {render :template => 'page/404', :status => 404}
|
35
|
-
format.json
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def set_locale
|
40
|
-
if params[:locale]
|
41
|
-
unless I18n.available_locales.include?(params[:locale].to_s.intern)
|
42
|
-
raise InvalidLocaleError
|
43
|
-
end
|
44
|
-
end
|
45
|
-
if user_signed_in?
|
46
|
-
locale = params[:locale] || session[:locale] || current_user.locale.try(:to_sym)
|
47
|
-
else
|
48
|
-
locale = params[:locale] || session[:locale]
|
49
|
-
end
|
50
|
-
if locale
|
51
|
-
I18n.locale = @locale = session[:locale] = locale.to_sym
|
52
|
-
else
|
53
|
-
I18n.locale = @locale = session[:locale] = I18n.default_locale
|
54
|
-
end
|
55
|
-
rescue InvalidLocaleError
|
56
|
-
@locale = I18n.default_locale
|
57
|
-
end
|
58
|
-
|
59
|
-
def access_denied
|
60
|
-
raise CanCan::AccessDenied
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
class InvalidLocaleError < StandardError
|
4
|
+
enju_leaf
|
5
|
+
enju_library
|
65
6
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# Use this hook to configure devise mailer, warden hooks and so forth.
|
2
2
|
# Many of these configuration options can be set straight in your model.
|
3
3
|
Devise.setup do |config|
|
4
|
+
config.secret_key = 'd5fa80a47d1c601d118c0054c889777fbe75b69644f690c97f4b9ce4312cb3036a01bf0713a3b0a2eee6be01a09f7a1e9db8575bee27079a2a08b1f3030ff9a2'
|
5
|
+
|
4
6
|
# ==> Mailer Configuration
|
5
7
|
# Configure the e-mail address which will be shown in Devise::Mailer,
|
6
8
|
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateLibraryGroups < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :library_groups do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.string :short_name, :null => false
|
7
|
+
t.string :email
|
8
|
+
t.text :my_networks
|
9
|
+
t.text :login_banner
|
10
|
+
t.text :note
|
11
|
+
t.integer :country_id
|
12
|
+
t.integer :position
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
add_index :library_groups, :short_name
|
17
|
+
end
|
18
|
+
end
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -66,6 +66,24 @@ ActiveRecord::Schema.define(:version => 20120413100431) do
|
|
66
66
|
add_index "items", ["required_role_id"], :name => "index_items_on_required_role_id"
|
67
67
|
add_index "items", ["shelf_id"], :name => "index_items_on_shelf_id"
|
68
68
|
|
69
|
+
create_table "library_groups", :force => true do |t|
|
70
|
+
t.string "name", :null => false
|
71
|
+
t.text "display_name"
|
72
|
+
t.string "short_name", :null => false
|
73
|
+
t.string "email"
|
74
|
+
t.text "my_networks"
|
75
|
+
t.text "login_banner"
|
76
|
+
t.text "note"
|
77
|
+
t.integer "country_id"
|
78
|
+
t.integer "position"
|
79
|
+
t.datetime "created_at", :null => false
|
80
|
+
t.datetime "updated_at", :null => false
|
81
|
+
t.text "admin_networks"
|
82
|
+
t.string "url", :default => "http://localhost:3000/"
|
83
|
+
end
|
84
|
+
|
85
|
+
add_index "library_groups", ["short_name"], :name => "index_library_groups_on_short_name"
|
86
|
+
|
69
87
|
create_table "roles", :force => true do |t|
|
70
88
|
t.string "name"
|
71
89
|
t.text "display_name"
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
2
|
+
one:
|
3
|
+
id: 1
|
4
|
+
name: enju_library
|
5
|
+
display_name: "<%= I18n.locale %>: Enju Library"
|
6
|
+
short_name: enju
|
7
|
+
email: next-l@library.example.jp
|
8
|
+
note:
|
9
|
+
my_networks: 0.0.0.0/0
|
10
|
+
url: "http://localhost:3000/"
|
11
|
+
position: 1
|
12
|
+
login_banner: "*Next-L Enju*"
|
13
|
+
admin_networks: 0.0.0.0/0
|
14
|
+
|
15
|
+
# == Schema Information
|
16
|
+
#
|
17
|
+
# Table name: library_groups
|
18
|
+
#
|
19
|
+
# id :integer not null, primary key
|
20
|
+
# name :string(255) not null
|
21
|
+
# display_name :text
|
22
|
+
# short_name :string(255) not null
|
23
|
+
# email :string(255)
|
24
|
+
# my_networks :text
|
25
|
+
# login_banner :text
|
26
|
+
# note :text
|
27
|
+
# country_id :integer
|
28
|
+
# position :integer
|
29
|
+
# created_at :datetime not null
|
30
|
+
# updated_at :datetime not null
|
31
|
+
# admin_networks :text
|
32
|
+
# url :string(255) default("http://localhost:3000/")
|
33
|
+
#
|
34
|
+
|
metadata
CHANGED
@@ -1,111 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_inventory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.11.
|
4
|
+
version: 0.1.11.pre9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kosuke Tanabe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: enju_seed
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.1.pre8
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.
|
26
|
+
version: 0.1.1.pre8
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: enju_leaf
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.1.0.rc7
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.1.0.rc7
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sqlite3
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec-rails
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: factory_girl_rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: mobylette
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - '>='
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - '>='
|
80
|
+
- - ">="
|
95
81
|
- !ruby/object:Gem::Version
|
96
82
|
version: '0'
|
97
83
|
description: Inventory management for Next-L Enju
|
98
84
|
email:
|
99
|
-
-
|
85
|
+
- kosuke@e23.jp
|
100
86
|
executables: []
|
101
87
|
extensions: []
|
102
88
|
extra_rdoc_files: []
|
103
89
|
files:
|
104
|
-
-
|
105
|
-
-
|
90
|
+
- MIT-LICENSE
|
91
|
+
- README.rdoc
|
92
|
+
- Rakefile
|
106
93
|
- app/controllers/inventories_controller.rb
|
107
94
|
- app/controllers/inventory_files_controller.rb
|
108
|
-
- app/helpers/enju_inventory/application_helper.rb
|
109
95
|
- app/models/enju_inventory/ability.rb
|
110
96
|
- app/models/inventory.rb
|
111
97
|
- app/models/inventory_file.rb
|
@@ -118,7 +104,6 @@ files:
|
|
118
104
|
- app/views/inventory_files/index.html.erb
|
119
105
|
- app/views/inventory_files/new.html.erb
|
120
106
|
- app/views/inventory_files/show.html.erb
|
121
|
-
- app/views/layouts/enju_inventory/application.html.erb
|
122
107
|
- config/locales/translation_en.yml
|
123
108
|
- config/locales/translation_ja.yml
|
124
109
|
- config/routes.rb
|
@@ -126,25 +111,20 @@ files:
|
|
126
111
|
- db/migrate/20081117143455_create_inventories.rb
|
127
112
|
- db/migrate/20090706125521_add_attachments_inventory_to_inventory_file.rb
|
128
113
|
- db/migrate/20120413100431_add_fingerprint_to_inventory_file.rb
|
114
|
+
- lib/enju_inventory.rb
|
129
115
|
- lib/enju_inventory/engine.rb
|
130
116
|
- lib/enju_inventory/item.rb
|
131
117
|
- lib/enju_inventory/version.rb
|
132
|
-
- lib/enju_inventory.rb
|
133
118
|
- lib/tasks/enju_inventory_tasks.rake
|
134
|
-
- MIT-LICENSE
|
135
|
-
- Rakefile
|
136
|
-
- README.rdoc
|
137
119
|
- spec/controllers/inventories_controller_spec.rb
|
138
120
|
- spec/controllers/inventory_files_controller_spec.rb
|
121
|
+
- spec/dummy/Rakefile
|
139
122
|
- spec/dummy/app/assets/javascripts/application.js
|
140
123
|
- spec/dummy/app/assets/stylesheets/application.css
|
141
124
|
- spec/dummy/app/controllers/application_controller.rb
|
142
125
|
- spec/dummy/app/helpers/application_helper.rb
|
143
126
|
- spec/dummy/app/models/ability.rb
|
144
|
-
- spec/dummy/app/models/item.rb
|
145
|
-
- spec/dummy/app/models/role.rb
|
146
127
|
- spec/dummy/app/models/user.rb
|
147
|
-
- spec/dummy/app/models/user_has_role.rb
|
148
128
|
- spec/dummy/app/views/layouts/application.html.erb
|
149
129
|
- spec/dummy/app/views/page/403.html.erb
|
150
130
|
- spec/dummy/app/views/page/403.mobile.erb
|
@@ -152,6 +132,7 @@ files:
|
|
152
132
|
- spec/dummy/app/views/page/404.html.erb
|
153
133
|
- spec/dummy/app/views/page/404.mobile.erb
|
154
134
|
- spec/dummy/app/views/page/404.xml.erb
|
135
|
+
- spec/dummy/config.ru
|
155
136
|
- spec/dummy/config/application.rb
|
156
137
|
- spec/dummy/config/application.yml
|
157
138
|
- spec/dummy/config/boot.rb
|
@@ -169,9 +150,10 @@ files:
|
|
169
150
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
170
151
|
- spec/dummy/config/locales/en.yml
|
171
152
|
- spec/dummy/config/routes.rb
|
172
|
-
- spec/dummy/config.ru
|
173
|
-
- spec/dummy/db/development.sqlite3
|
174
153
|
- spec/dummy/db/migrate/006_create_items.rb
|
154
|
+
- spec/dummy/db/migrate/080_create_library_groups.rb
|
155
|
+
- spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb
|
156
|
+
- spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb
|
175
157
|
- spec/dummy/db/migrate/20111201121844_create_roles.rb
|
176
158
|
- spec/dummy/db/migrate/20111201155456_create_users.rb
|
177
159
|
- spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb
|
@@ -184,11 +166,11 @@ files:
|
|
184
166
|
- spec/dummy/public/422.html
|
185
167
|
- spec/dummy/public/500.html
|
186
168
|
- spec/dummy/public/favicon.ico
|
187
|
-
- spec/dummy/Rakefile
|
188
169
|
- spec/dummy/script/rails
|
189
170
|
- spec/factories/user.rb
|
190
171
|
- spec/fixtures/inventories.yml
|
191
172
|
- spec/fixtures/inventory_files.yml
|
173
|
+
- spec/fixtures/library_groups.yml
|
192
174
|
- spec/fixtures/roles.yml
|
193
175
|
- spec/fixtures/user_has_roles.yml
|
194
176
|
- spec/fixtures/users.yml
|
@@ -206,17 +188,17 @@ require_paths:
|
|
206
188
|
- lib
|
207
189
|
required_ruby_version: !ruby/object:Gem::Requirement
|
208
190
|
requirements:
|
209
|
-
- -
|
191
|
+
- - ">="
|
210
192
|
- !ruby/object:Gem::Version
|
211
193
|
version: '0'
|
212
194
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
195
|
requirements:
|
214
|
-
- -
|
196
|
+
- - ">"
|
215
197
|
- !ruby/object:Gem::Version
|
216
198
|
version: 1.3.1
|
217
199
|
requirements: []
|
218
200
|
rubyforge_project:
|
219
|
-
rubygems_version: 2.
|
201
|
+
rubygems_version: 2.2.0
|
220
202
|
signing_key:
|
221
203
|
specification_version: 4
|
222
204
|
summary: enju_inventory plugin
|
@@ -228,10 +210,7 @@ test_files:
|
|
228
210
|
- spec/dummy/app/controllers/application_controller.rb
|
229
211
|
- spec/dummy/app/helpers/application_helper.rb
|
230
212
|
- spec/dummy/app/models/ability.rb
|
231
|
-
- spec/dummy/app/models/item.rb
|
232
|
-
- spec/dummy/app/models/role.rb
|
233
213
|
- spec/dummy/app/models/user.rb
|
234
|
-
- spec/dummy/app/models/user_has_role.rb
|
235
214
|
- spec/dummy/app/views/layouts/application.html.erb
|
236
215
|
- spec/dummy/app/views/page/403.html.erb
|
237
216
|
- spec/dummy/app/views/page/403.mobile.erb
|
@@ -257,8 +236,10 @@ test_files:
|
|
257
236
|
- spec/dummy/config/locales/en.yml
|
258
237
|
- spec/dummy/config/routes.rb
|
259
238
|
- spec/dummy/config.ru
|
260
|
-
- spec/dummy/db/development.sqlite3
|
261
239
|
- spec/dummy/db/migrate/006_create_items.rb
|
240
|
+
- spec/dummy/db/migrate/080_create_library_groups.rb
|
241
|
+
- spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb
|
242
|
+
- spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb
|
262
243
|
- spec/dummy/db/migrate/20111201121844_create_roles.rb
|
263
244
|
- spec/dummy/db/migrate/20111201155456_create_users.rb
|
264
245
|
- spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb
|
@@ -276,6 +257,7 @@ test_files:
|
|
276
257
|
- spec/factories/user.rb
|
277
258
|
- spec/fixtures/inventories.yml
|
278
259
|
- spec/fixtures/inventory_files.yml
|
260
|
+
- spec/fixtures/library_groups.yml
|
279
261
|
- spec/fixtures/roles.yml
|
280
262
|
- spec/fixtures/user_has_roles.yml
|
281
263
|
- spec/fixtures/users.yml
|
@@ -1,15 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// the compiled file.
|
9
|
-
//
|
10
|
-
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
-
// GO AFTER THE REQUIRES BELOW.
|
12
|
-
//
|
13
|
-
//= require jquery
|
14
|
-
//= require jquery_ujs
|
15
|
-
//= require_tree .
|
@@ -1,13 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
-
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
-
*
|
11
|
-
*= require_self
|
12
|
-
*= require_tree .
|
13
|
-
*/
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>EnjuInventory</title>
|
5
|
-
<%= stylesheet_link_tag "enju_inventory/application", :media => "all" %>
|
6
|
-
<%= javascript_include_tag "enju_inventory/application" %>
|
7
|
-
<%= csrf_meta_tags %>
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
|
11
|
-
<%= yield %>
|
12
|
-
|
13
|
-
</body>
|
14
|
-
</html>
|
@@ -1,20 +0,0 @@
|
|
1
|
-
class Item < ActiveRecord::Base
|
2
|
-
has_many :inventories, :dependent => :destroy
|
3
|
-
has_many :inventory_files, :through => :inventories
|
4
|
-
searchable do
|
5
|
-
integer :inventory_file_ids, :multiple => true
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.inventory_items(inventory_file, mode = 'not_on_shelf')
|
9
|
-
item_ids = Item.select(:id).collect(&:id)
|
10
|
-
inventory_item_ids = inventory_file.items.select('items.id').collect(&:id)
|
11
|
-
case mode
|
12
|
-
when 'not_on_shelf'
|
13
|
-
Item.where(:id => (item_ids - inventory_item_ids))
|
14
|
-
when 'not_in_catalog'
|
15
|
-
Item.where(:id => (inventory_item_ids - item_ids))
|
16
|
-
end
|
17
|
-
rescue
|
18
|
-
nil
|
19
|
-
end
|
20
|
-
end
|
Binary file
|