enju_circulation 0.0.45 → 0.0.46
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.
- data/MIT-LICENSE +1 -1
- data/Rakefile +11 -0
- data/app/models/checkin.rb +2 -3
- data/app/models/checkout.rb +2 -3
- data/app/models/reserve.rb +2 -3
- data/app/models/user_checkout_stat.rb +2 -3
- data/app/models/user_reserve_stat.rb +2 -3
- data/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +1 -1
- data/lib/enju_circulation/engine.rb +1 -1
- data/lib/enju_circulation/version.rb +1 -1
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/config/environments/development.rb +8 -1
- data/spec/dummy/config/environments/production.rb +8 -1
- data/spec/dummy/config/environments/test.rb +4 -6
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/public/500.html +0 -1
- data/spec/fixtures/checkins.yml +2 -3
- data/spec/fixtures/checkouts.yml +2 -3
- data/spec/fixtures/reserves.yml +2 -3
- data/spec/fixtures/user_checkout_stats.yml +2 -3
- data/spec/fixtures/user_reserve_stats.yml +2 -3
- data/spec/models/checkin_spec.rb +2 -3
- data/spec/models/checkout_spec.rb +2 -3
- data/spec/models/reserve_spec.rb +2 -3
- data/spec/models/user_checkout_stat_spec.rb +2 -3
- data/spec/models/user_reserve_stat_spec.rb +2 -3
- metadata +4 -2
data/MIT-LICENSE
CHANGED
data/Rakefile
CHANGED
@@ -33,4 +33,15 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
33
33
|
spec.pattern = FileList['spec/**/*_spec.rb']
|
34
34
|
end
|
35
35
|
|
36
|
+
task :default => :spec
|
37
|
+
require 'rake/testtask'
|
38
|
+
|
39
|
+
Rake::TestTask.new(:test) do |t|
|
40
|
+
t.libs << 'lib'
|
41
|
+
t.libs << 'test'
|
42
|
+
t.pattern = 'test/**/*_test.rb'
|
43
|
+
t.verbose = false
|
44
|
+
end
|
45
|
+
|
46
|
+
|
36
47
|
task :default => :spec
|
data/app/models/checkin.rb
CHANGED
@@ -55,7 +55,6 @@ class Checkin < ActiveRecord::Base
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
58
|
-
|
59
58
|
# == Schema Information
|
60
59
|
#
|
61
60
|
# Table name: checkins
|
@@ -64,7 +63,7 @@ end
|
|
64
63
|
# item_id :integer not null
|
65
64
|
# librarian_id :integer
|
66
65
|
# basket_id :integer
|
67
|
-
# created_at :datetime
|
68
|
-
# updated_at :datetime
|
66
|
+
# created_at :datetime not null
|
67
|
+
# updated_at :datetime not null
|
69
68
|
#
|
70
69
|
|
data/app/models/checkout.rb
CHANGED
@@ -111,7 +111,6 @@ class Checkout < ActiveRecord::Base
|
|
111
111
|
user.checkouts.update_all(:user_id => nil)
|
112
112
|
end
|
113
113
|
end
|
114
|
-
|
115
114
|
# == Schema Information
|
116
115
|
#
|
117
116
|
# Table name: checkouts
|
@@ -125,7 +124,7 @@ end
|
|
125
124
|
# due_date :datetime
|
126
125
|
# checkout_renewal_count :integer default(0), not null
|
127
126
|
# lock_version :integer default(0), not null
|
128
|
-
# created_at :datetime
|
129
|
-
# updated_at :datetime
|
127
|
+
# created_at :datetime not null
|
128
|
+
# updated_at :datetime not null
|
130
129
|
#
|
131
130
|
|
data/app/models/reserve.rb
CHANGED
@@ -270,7 +270,6 @@ class Reserve < ActiveRecord::Base
|
|
270
270
|
has_one :inter_library_loan
|
271
271
|
end
|
272
272
|
end
|
273
|
-
|
274
273
|
# == Schema Information
|
275
274
|
#
|
276
275
|
# Table name: reserves
|
@@ -281,8 +280,8 @@ end
|
|
281
280
|
# item_id :integer
|
282
281
|
# request_status_type_id :integer not null
|
283
282
|
# checked_out_at :datetime
|
284
|
-
# created_at :datetime
|
285
|
-
# updated_at :datetime
|
283
|
+
# created_at :datetime not null
|
284
|
+
# updated_at :datetime not null
|
286
285
|
# canceled_at :datetime
|
287
286
|
# expired_at :datetime
|
288
287
|
# deleted_at :datetime
|
@@ -32,7 +32,6 @@ class UserCheckoutStat < ActiveRecord::Base
|
|
32
32
|
self.completed_at = Time.zone.now
|
33
33
|
end
|
34
34
|
end
|
35
|
-
|
36
35
|
# == Schema Information
|
37
36
|
#
|
38
37
|
# Table name: user_checkout_stats
|
@@ -42,8 +41,8 @@ end
|
|
42
41
|
# end_date :datetime
|
43
42
|
# note :text
|
44
43
|
# state :string(255)
|
45
|
-
# created_at :datetime
|
46
|
-
# updated_at :datetime
|
44
|
+
# created_at :datetime not null
|
45
|
+
# updated_at :datetime not null
|
47
46
|
# started_at :datetime
|
48
47
|
# completed_at :datetime
|
49
48
|
#
|
@@ -32,7 +32,6 @@ class UserReserveStat < ActiveRecord::Base
|
|
32
32
|
self.completed_at = Time.zone.now
|
33
33
|
end
|
34
34
|
end
|
35
|
-
|
36
35
|
# == Schema Information
|
37
36
|
#
|
38
37
|
# Table name: user_reserve_stats
|
@@ -42,8 +41,8 @@ end
|
|
42
41
|
# end_date :datetime
|
43
42
|
# note :text
|
44
43
|
# state :string(255)
|
45
|
-
# created_at :datetime
|
46
|
-
# updated_at :datetime
|
44
|
+
# created_at :datetime not null
|
45
|
+
# updated_at :datetime not null
|
47
46
|
# started_at :datetime
|
48
47
|
# completed_at :datetime
|
49
48
|
#
|
@@ -0,0 +1,261 @@
|
|
1
|
+
== Welcome to Rails
|
2
|
+
|
3
|
+
Rails is a web-application framework that includes everything needed to create
|
4
|
+
database-backed web applications according to the Model-View-Control pattern.
|
5
|
+
|
6
|
+
This pattern splits the view (also called the presentation) into "dumb"
|
7
|
+
templates that are primarily responsible for inserting pre-built data in between
|
8
|
+
HTML tags. The model contains the "smart" domain objects (such as Account,
|
9
|
+
Product, Person, Post) that holds all the business logic and knows how to
|
10
|
+
persist themselves to a database. The controller handles the incoming requests
|
11
|
+
(such as Save New Account, Update Product, Show Post) by manipulating the model
|
12
|
+
and directing data to the view.
|
13
|
+
|
14
|
+
In Rails, the model is handled by what's called an object-relational mapping
|
15
|
+
layer entitled Active Record. This layer allows you to present the data from
|
16
|
+
database rows as objects and embellish these data objects with business logic
|
17
|
+
methods. You can read more about Active Record in
|
18
|
+
link:files/vendor/rails/activerecord/README.html.
|
19
|
+
|
20
|
+
The controller and view are handled by the Action Pack, which handles both
|
21
|
+
layers by its two parts: Action View and Action Controller. These two layers
|
22
|
+
are bundled in a single package due to their heavy interdependence. This is
|
23
|
+
unlike the relationship between the Active Record and Action Pack that is much
|
24
|
+
more separate. Each of these packages can be used independently outside of
|
25
|
+
Rails. You can read more about Action Pack in
|
26
|
+
link:files/vendor/rails/actionpack/README.html.
|
27
|
+
|
28
|
+
|
29
|
+
== Getting Started
|
30
|
+
|
31
|
+
1. At the command prompt, create a new Rails application:
|
32
|
+
<tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
|
33
|
+
|
34
|
+
2. Change directory to <tt>myapp</tt> and start the web server:
|
35
|
+
<tt>cd myapp; rails server</tt> (run with --help for options)
|
36
|
+
|
37
|
+
3. Go to http://localhost:3000/ and you'll see:
|
38
|
+
"Welcome aboard: You're riding Ruby on Rails!"
|
39
|
+
|
40
|
+
4. Follow the guidelines to start developing your application. You can find
|
41
|
+
the following resources handy:
|
42
|
+
|
43
|
+
* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
|
44
|
+
* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
|
45
|
+
|
46
|
+
|
47
|
+
== Debugging Rails
|
48
|
+
|
49
|
+
Sometimes your application goes wrong. Fortunately there are a lot of tools that
|
50
|
+
will help you debug it and get it back on the rails.
|
51
|
+
|
52
|
+
First area to check is the application log files. Have "tail -f" commands
|
53
|
+
running on the server.log and development.log. Rails will automatically display
|
54
|
+
debugging and runtime information to these files. Debugging info will also be
|
55
|
+
shown in the browser on requests from 127.0.0.1.
|
56
|
+
|
57
|
+
You can also log your own messages directly into the log file from your code
|
58
|
+
using the Ruby logger class from inside your controllers. Example:
|
59
|
+
|
60
|
+
class WeblogController < ActionController::Base
|
61
|
+
def destroy
|
62
|
+
@weblog = Weblog.find(params[:id])
|
63
|
+
@weblog.destroy
|
64
|
+
logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
The result will be a message in your log file along the lines of:
|
69
|
+
|
70
|
+
Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
|
71
|
+
|
72
|
+
More information on how to use the logger is at http://www.ruby-doc.org/core/
|
73
|
+
|
74
|
+
Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
|
75
|
+
several books available online as well:
|
76
|
+
|
77
|
+
* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
|
78
|
+
* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
|
79
|
+
|
80
|
+
These two books will bring you up to speed on the Ruby language and also on
|
81
|
+
programming in general.
|
82
|
+
|
83
|
+
|
84
|
+
== Debugger
|
85
|
+
|
86
|
+
Debugger support is available through the debugger command when you start your
|
87
|
+
Mongrel or WEBrick server with --debugger. This means that you can break out of
|
88
|
+
execution at any point in the code, investigate and change the model, and then,
|
89
|
+
resume execution! You need to install ruby-debug to run the server in debugging
|
90
|
+
mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
|
91
|
+
|
92
|
+
class WeblogController < ActionController::Base
|
93
|
+
def index
|
94
|
+
@posts = Post.all
|
95
|
+
debugger
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
So the controller will accept the action, run the first line, then present you
|
100
|
+
with a IRB prompt in the server window. Here you can do things like:
|
101
|
+
|
102
|
+
>> @posts.inspect
|
103
|
+
=> "[#<Post:0x14a6be8
|
104
|
+
@attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
|
105
|
+
#<Post:0x14a6620
|
106
|
+
@attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
|
107
|
+
>> @posts.first.title = "hello from a debugger"
|
108
|
+
=> "hello from a debugger"
|
109
|
+
|
110
|
+
...and even better, you can examine how your runtime objects actually work:
|
111
|
+
|
112
|
+
>> f = @posts.first
|
113
|
+
=> #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
|
114
|
+
>> f.
|
115
|
+
Display all 152 possibilities? (y or n)
|
116
|
+
|
117
|
+
Finally, when you're ready to resume execution, you can enter "cont".
|
118
|
+
|
119
|
+
|
120
|
+
== Console
|
121
|
+
|
122
|
+
The console is a Ruby shell, which allows you to interact with your
|
123
|
+
application's domain model. Here you'll have all parts of the application
|
124
|
+
configured, just like it is when the application is running. You can inspect
|
125
|
+
domain models, change values, and save to the database. Starting the script
|
126
|
+
without arguments will launch it in the development environment.
|
127
|
+
|
128
|
+
To start the console, run <tt>rails console</tt> from the application
|
129
|
+
directory.
|
130
|
+
|
131
|
+
Options:
|
132
|
+
|
133
|
+
* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
|
134
|
+
made to the database.
|
135
|
+
* Passing an environment name as an argument will load the corresponding
|
136
|
+
environment. Example: <tt>rails console production</tt>.
|
137
|
+
|
138
|
+
To reload your controllers and models after launching the console run
|
139
|
+
<tt>reload!</tt>
|
140
|
+
|
141
|
+
More information about irb can be found at:
|
142
|
+
link:http://www.rubycentral.org/pickaxe/irb.html
|
143
|
+
|
144
|
+
|
145
|
+
== dbconsole
|
146
|
+
|
147
|
+
You can go to the command line of your database directly through <tt>rails
|
148
|
+
dbconsole</tt>. You would be connected to the database with the credentials
|
149
|
+
defined in database.yml. Starting the script without arguments will connect you
|
150
|
+
to the development database. Passing an argument will connect you to a different
|
151
|
+
database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
|
152
|
+
PostgreSQL and SQLite 3.
|
153
|
+
|
154
|
+
== Description of Contents
|
155
|
+
|
156
|
+
The default directory structure of a generated Ruby on Rails application:
|
157
|
+
|
158
|
+
|-- app
|
159
|
+
| |-- assets
|
160
|
+
| |-- images
|
161
|
+
| |-- javascripts
|
162
|
+
| `-- stylesheets
|
163
|
+
| |-- controllers
|
164
|
+
| |-- helpers
|
165
|
+
| |-- mailers
|
166
|
+
| |-- models
|
167
|
+
| `-- views
|
168
|
+
| `-- layouts
|
169
|
+
|-- config
|
170
|
+
| |-- environments
|
171
|
+
| |-- initializers
|
172
|
+
| `-- locales
|
173
|
+
|-- db
|
174
|
+
|-- doc
|
175
|
+
|-- lib
|
176
|
+
| `-- tasks
|
177
|
+
|-- log
|
178
|
+
|-- public
|
179
|
+
|-- script
|
180
|
+
|-- test
|
181
|
+
| |-- fixtures
|
182
|
+
| |-- functional
|
183
|
+
| |-- integration
|
184
|
+
| |-- performance
|
185
|
+
| `-- unit
|
186
|
+
|-- tmp
|
187
|
+
| |-- cache
|
188
|
+
| |-- pids
|
189
|
+
| |-- sessions
|
190
|
+
| `-- sockets
|
191
|
+
`-- vendor
|
192
|
+
|-- assets
|
193
|
+
`-- stylesheets
|
194
|
+
`-- plugins
|
195
|
+
|
196
|
+
app
|
197
|
+
Holds all the code that's specific to this particular application.
|
198
|
+
|
199
|
+
app/assets
|
200
|
+
Contains subdirectories for images, stylesheets, and JavaScript files.
|
201
|
+
|
202
|
+
app/controllers
|
203
|
+
Holds controllers that should be named like weblogs_controller.rb for
|
204
|
+
automated URL mapping. All controllers should descend from
|
205
|
+
ApplicationController which itself descends from ActionController::Base.
|
206
|
+
|
207
|
+
app/models
|
208
|
+
Holds models that should be named like post.rb. Models descend from
|
209
|
+
ActiveRecord::Base by default.
|
210
|
+
|
211
|
+
app/views
|
212
|
+
Holds the template files for the view that should be named like
|
213
|
+
weblogs/index.html.erb for the WeblogsController#index action. All views use
|
214
|
+
eRuby syntax by default.
|
215
|
+
|
216
|
+
app/views/layouts
|
217
|
+
Holds the template files for layouts to be used with views. This models the
|
218
|
+
common header/footer method of wrapping views. In your views, define a layout
|
219
|
+
using the <tt>layout :default</tt> and create a file named default.html.erb.
|
220
|
+
Inside default.html.erb, call <% yield %> to render the view using this
|
221
|
+
layout.
|
222
|
+
|
223
|
+
app/helpers
|
224
|
+
Holds view helpers that should be named like weblogs_helper.rb. These are
|
225
|
+
generated for you automatically when using generators for controllers.
|
226
|
+
Helpers can be used to wrap functionality for your views into methods.
|
227
|
+
|
228
|
+
config
|
229
|
+
Configuration files for the Rails environment, the routing map, the database,
|
230
|
+
and other dependencies.
|
231
|
+
|
232
|
+
db
|
233
|
+
Contains the database schema in schema.rb. db/migrate contains all the
|
234
|
+
sequence of Migrations for your schema.
|
235
|
+
|
236
|
+
doc
|
237
|
+
This directory is where your application documentation will be stored when
|
238
|
+
generated using <tt>rake doc:app</tt>
|
239
|
+
|
240
|
+
lib
|
241
|
+
Application specific libraries. Basically, any kind of custom code that
|
242
|
+
doesn't belong under controllers, models, or helpers. This directory is in
|
243
|
+
the load path.
|
244
|
+
|
245
|
+
public
|
246
|
+
The directory available for the web server. Also contains the dispatchers and the
|
247
|
+
default HTML files. This should be set as the DOCUMENT_ROOT of your web
|
248
|
+
server.
|
249
|
+
|
250
|
+
script
|
251
|
+
Helper scripts for automation and generation.
|
252
|
+
|
253
|
+
test
|
254
|
+
Unit and functional tests along with fixtures. When using the rails generate
|
255
|
+
command, template test files will be generated for you and placed in this
|
256
|
+
directory.
|
257
|
+
|
258
|
+
vendor
|
259
|
+
External libraries that the application depends on. Also includes the plugins
|
260
|
+
subdirectory. If the app has frozen rails, those gems also go here, under
|
261
|
+
vendor/rails/. This directory is in the load path.
|
@@ -2,7 +2,7 @@ Dummy::Application.configure do
|
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
5
|
-
# every request.
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
6
|
# since you don't have to restart the web server when you make code changes.
|
7
7
|
config.cache_classes = false
|
8
8
|
|
@@ -22,6 +22,13 @@ Dummy::Application.configure do
|
|
22
22
|
# Only use best-standards-support built into browsers
|
23
23
|
config.action_dispatch.best_standards_support = :builtin
|
24
24
|
|
25
|
+
# Raise exception on mass assignment protection for Active Record models
|
26
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
27
|
+
|
28
|
+
# Log the query plan for queries taking more than this (works
|
29
|
+
# with SQLite, MySQL, and PostgreSQL)
|
30
|
+
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
31
|
+
|
25
32
|
# Do not compress assets
|
26
33
|
config.assets.compress = false
|
27
34
|
|
@@ -33,8 +33,11 @@ Dummy::Application.configure do
|
|
33
33
|
# See everything in the log (default is :info)
|
34
34
|
# config.log_level = :debug
|
35
35
|
|
36
|
+
# Prepend all log lines with the following tags
|
37
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
38
|
+
|
36
39
|
# Use a different logger for distributed setups
|
37
|
-
# config.logger = SyslogLogger.new
|
40
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
38
41
|
|
39
42
|
# Use a different cache store in production
|
40
43
|
# config.cache_store = :mem_cache_store
|
@@ -57,4 +60,8 @@ Dummy::Application.configure do
|
|
57
60
|
|
58
61
|
# Send deprecation notices to registered listeners
|
59
62
|
config.active_support.deprecation = :notify
|
63
|
+
|
64
|
+
# Log the query plan for queries taking more than this (works
|
65
|
+
# with SQLite, MySQL, and PostgreSQL)
|
66
|
+
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
60
67
|
end
|
@@ -2,9 +2,9 @@ Dummy::Application.configure do
|
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
5
|
-
# test suite.
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
6
|
# your test database is "scratch space" for the test suite and is wiped
|
7
|
-
# and recreated between test runs.
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
10
|
# Configure static asset server for tests with Cache-Control for performance
|
@@ -29,10 +29,8 @@ Dummy::Application.configure do
|
|
29
29
|
# ActionMailer::Base.deliveries array.
|
30
30
|
config.action_mailer.delivery_method = :test
|
31
31
|
|
32
|
-
#
|
33
|
-
#
|
34
|
-
# like if you have constraints or database-specific column types
|
35
|
-
# config.active_record.schema_format = :sql
|
32
|
+
# Raise exception on mass assignment protection for Active Record models
|
33
|
+
#config.active_record.mass_assignment_sanitizer = :strict
|
36
34
|
|
37
35
|
# Print deprecation notices to the stderr
|
38
36
|
config.active_support.deprecation = :stderr
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/spec/dummy/public/500.html
CHANGED
data/spec/fixtures/checkins.yml
CHANGED
@@ -34,7 +34,6 @@ checkin_00005:
|
|
34
34
|
librarian_id: 1
|
35
35
|
created_at: 2007-12-20 21:25:04.619479 +09:00
|
36
36
|
basket_id: 10
|
37
|
-
|
38
37
|
# == Schema Information
|
39
38
|
#
|
40
39
|
# Table name: checkins
|
@@ -43,7 +42,7 @@ checkin_00005:
|
|
43
42
|
# item_id :integer not null
|
44
43
|
# librarian_id :integer
|
45
44
|
# basket_id :integer
|
46
|
-
# created_at :datetime
|
47
|
-
# updated_at :datetime
|
45
|
+
# created_at :datetime not null
|
46
|
+
# updated_at :datetime not null
|
48
47
|
#
|
49
48
|
|
data/spec/fixtures/checkouts.yml
CHANGED
@@ -143,7 +143,6 @@ checkout_00013:
|
|
143
143
|
created_at: 2007-09-08 01:39:03.210081 +09:00
|
144
144
|
basket_id: 8
|
145
145
|
checkin_id: 4
|
146
|
-
|
147
146
|
# == Schema Information
|
148
147
|
#
|
149
148
|
# Table name: checkouts
|
@@ -157,7 +156,7 @@ checkout_00013:
|
|
157
156
|
# due_date :datetime
|
158
157
|
# checkout_renewal_count :integer default(0), not null
|
159
158
|
# lock_version :integer default(0), not null
|
160
|
-
# created_at :datetime
|
161
|
-
# updated_at :datetime
|
159
|
+
# created_at :datetime not null
|
160
|
+
# updated_at :datetime not null
|
162
161
|
#
|
163
162
|
|
data/spec/fixtures/reserves.yml
CHANGED
@@ -136,7 +136,6 @@ reserve_00015:
|
|
136
136
|
created_at: 2007-09-01 14:20:05.530854 +09:00
|
137
137
|
expired_at: <%= 1.day.from_now %>
|
138
138
|
state: requested
|
139
|
-
|
140
139
|
# == Schema Information
|
141
140
|
#
|
142
141
|
# Table name: reserves
|
@@ -147,8 +146,8 @@ reserve_00015:
|
|
147
146
|
# item_id :integer
|
148
147
|
# request_status_type_id :integer not null
|
149
148
|
# checked_out_at :datetime
|
150
|
-
# created_at :datetime
|
151
|
-
# updated_at :datetime
|
149
|
+
# created_at :datetime not null
|
150
|
+
# updated_at :datetime not null
|
152
151
|
# canceled_at :datetime
|
153
152
|
# expired_at :datetime
|
154
153
|
# deleted_at :datetime
|
@@ -13,7 +13,6 @@ two:
|
|
13
13
|
end_date: 2008-12-16 18:43:02
|
14
14
|
note: MyText
|
15
15
|
state: pending
|
16
|
-
|
17
16
|
# == Schema Information
|
18
17
|
#
|
19
18
|
# Table name: user_checkout_stats
|
@@ -23,8 +22,8 @@ two:
|
|
23
22
|
# end_date :datetime
|
24
23
|
# note :text
|
25
24
|
# state :string(255)
|
26
|
-
# created_at :datetime
|
27
|
-
# updated_at :datetime
|
25
|
+
# created_at :datetime not null
|
26
|
+
# updated_at :datetime not null
|
28
27
|
# started_at :datetime
|
29
28
|
# completed_at :datetime
|
30
29
|
#
|
@@ -13,7 +13,6 @@ two:
|
|
13
13
|
end_date: 2008-12-21 11:36:28
|
14
14
|
note: MyText
|
15
15
|
state: pending
|
16
|
-
|
17
16
|
# == Schema Information
|
18
17
|
#
|
19
18
|
# Table name: user_reserve_stats
|
@@ -23,8 +22,8 @@ two:
|
|
23
22
|
# end_date :datetime
|
24
23
|
# note :text
|
25
24
|
# state :string(255)
|
26
|
-
# created_at :datetime
|
27
|
-
# updated_at :datetime
|
25
|
+
# created_at :datetime not null
|
26
|
+
# updated_at :datetime not null
|
28
27
|
# started_at :datetime
|
29
28
|
# completed_at :datetime
|
30
29
|
#
|
data/spec/models/checkin_spec.rb
CHANGED
@@ -33,7 +33,6 @@ describe Checkin do
|
|
33
33
|
user.checkouts.count.should eq checkouts_count - 1
|
34
34
|
end
|
35
35
|
end
|
36
|
-
|
37
36
|
# == Schema Information
|
38
37
|
#
|
39
38
|
# Table name: checkins
|
@@ -42,7 +41,7 @@ end
|
|
42
41
|
# item_id :integer not null
|
43
42
|
# librarian_id :integer
|
44
43
|
# basket_id :integer
|
45
|
-
# created_at :datetime
|
46
|
-
# updated_at :datetime
|
44
|
+
# created_at :datetime not null
|
45
|
+
# updated_at :datetime not null
|
47
46
|
#
|
48
47
|
|
@@ -55,7 +55,6 @@ describe Checkout do
|
|
55
55
|
Checkout.count.should eq old_count
|
56
56
|
end
|
57
57
|
end
|
58
|
-
|
59
58
|
# == Schema Information
|
60
59
|
#
|
61
60
|
# Table name: checkouts
|
@@ -69,7 +68,7 @@ end
|
|
69
68
|
# due_date :datetime
|
70
69
|
# checkout_renewal_count :integer default(0), not null
|
71
70
|
# lock_version :integer default(0), not null
|
72
|
-
# created_at :datetime
|
73
|
-
# updated_at :datetime
|
71
|
+
# created_at :datetime not null
|
72
|
+
# updated_at :datetime not null
|
74
73
|
#
|
75
74
|
|
data/spec/models/reserve_spec.rb
CHANGED
@@ -67,7 +67,6 @@ describe Reserve do
|
|
67
67
|
assert Reserve.expire.should be_true
|
68
68
|
end
|
69
69
|
end
|
70
|
-
|
71
70
|
# == Schema Information
|
72
71
|
#
|
73
72
|
# Table name: reserves
|
@@ -78,8 +77,8 @@ end
|
|
78
77
|
# item_id :integer
|
79
78
|
# request_status_type_id :integer not null
|
80
79
|
# checked_out_at :datetime
|
81
|
-
# created_at :datetime
|
82
|
-
# updated_at :datetime
|
80
|
+
# created_at :datetime not null
|
81
|
+
# updated_at :datetime not null
|
83
82
|
# canceled_at :datetime
|
84
83
|
# expired_at :datetime
|
85
84
|
# deleted_at :datetime
|
@@ -8,7 +8,6 @@ describe UserCheckoutStat do
|
|
8
8
|
user_checkout_stats(:one).calculate_count.should be_true
|
9
9
|
end
|
10
10
|
end
|
11
|
-
|
12
11
|
# == Schema Information
|
13
12
|
#
|
14
13
|
# Table name: user_checkout_stats
|
@@ -18,8 +17,8 @@ end
|
|
18
17
|
# end_date :datetime
|
19
18
|
# note :text
|
20
19
|
# state :string(255)
|
21
|
-
# created_at :datetime
|
22
|
-
# updated_at :datetime
|
20
|
+
# created_at :datetime not null
|
21
|
+
# updated_at :datetime not null
|
23
22
|
# started_at :datetime
|
24
23
|
# completed_at :datetime
|
25
24
|
#
|
@@ -8,7 +8,6 @@ describe UserReserveStat do
|
|
8
8
|
user_reserve_stats(:one).calculate_count.should be_true
|
9
9
|
end
|
10
10
|
end
|
11
|
-
|
12
11
|
# == Schema Information
|
13
12
|
#
|
14
13
|
# Table name: user_reserve_stats
|
@@ -18,8 +17,8 @@ end
|
|
18
17
|
# end_date :datetime
|
19
18
|
# note :text
|
20
19
|
# state :string(255)
|
21
|
-
# created_at :datetime
|
22
|
-
# updated_at :datetime
|
20
|
+
# created_at :datetime not null
|
21
|
+
# updated_at :datetime not null
|
23
22
|
# started_at :datetime
|
24
23
|
# completed_at :datetime
|
25
24
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_circulation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.46
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -650,6 +650,7 @@ files:
|
|
650
650
|
- spec/dummy/public/500.html
|
651
651
|
- spec/dummy/public/favicon.ico
|
652
652
|
- spec/dummy/Rakefile
|
653
|
+
- spec/dummy/README.rdoc
|
653
654
|
- spec/dummy/script/delayed_job
|
654
655
|
- spec/dummy/script/rails
|
655
656
|
- spec/dummy/solr/conf/admin-extra.html
|
@@ -898,6 +899,7 @@ test_files:
|
|
898
899
|
- spec/dummy/public/500.html
|
899
900
|
- spec/dummy/public/favicon.ico
|
900
901
|
- spec/dummy/Rakefile
|
902
|
+
- spec/dummy/README.rdoc
|
901
903
|
- spec/dummy/script/delayed_job
|
902
904
|
- spec/dummy/script/rails
|
903
905
|
- spec/dummy/solr/conf/admin-extra.html
|