enju_question 0.1.0.pre8 → 0.1.0.pre9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/lib/enju_question/version.rb +1 -1
  3. data/spec/controllers/answers_controller_spec.rb +12 -6
  4. data/spec/controllers/questions_controller_spec.rb +16 -8
  5. data/spec/dummy/app/controllers/application_controller.rb +2 -97
  6. data/spec/dummy/config/application.rb +1 -2
  7. data/spec/dummy/db/development.sqlite3 +0 -0
  8. data/spec/dummy/db/migrate/{001_create_patrons.rb → 001_create_agents.rb} +8 -8
  9. data/spec/dummy/db/migrate/012_create_owns.rb +2 -2
  10. data/spec/dummy/db/migrate/015_create_creates.rb +2 -2
  11. data/spec/dummy/db/migrate/047_create_produces.rb +2 -2
  12. data/spec/dummy/db/migrate/080_create_library_groups.rb +18 -0
  13. data/spec/dummy/db/migrate/125_create_donates.rb +2 -2
  14. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +2 -2
  15. data/spec/dummy/db/migrate/{20080905191442_create_patron_types.rb → 20080905191442_create_agent_types.rb} +2 -2
  16. data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +22 -0
  17. data/spec/dummy/db/migrate/{20090812151902_create_patron_relationship_types.rb → 20090812151902_create_agent_relationship_types.rb} +2 -2
  18. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +2 -2
  19. data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +9 -0
  20. data/spec/dummy/db/migrate/20100606073747_create_agent_relationships.rb +13 -0
  21. data/spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb +11 -0
  22. data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +12 -0
  23. data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +9 -0
  24. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +11 -0
  25. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +5 -0
  26. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +5 -0
  27. data/spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +6 -0
  28. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +5 -0
  29. data/spec/dummy/db/schema.rb +156 -140
  30. data/spec/dummy/db/test.sqlite3 +0 -0
  31. data/spec/dummy/solr/data/test/index/{_63.fdt → _9l.fdt} +0 -0
  32. data/spec/dummy/solr/data/test/index/{_63.fdx → _9l.fdx} +0 -0
  33. data/spec/dummy/solr/data/test/index/{_63.fnm → _9l.fnm} +0 -0
  34. data/spec/dummy/solr/data/test/index/{_63.frq → _9l.frq} +0 -0
  35. data/spec/dummy/solr/data/test/index/{_63.nrm → _9l.nrm} +0 -0
  36. data/spec/dummy/solr/data/test/index/{_63.prx → _9l.prx} +0 -0
  37. data/spec/dummy/solr/data/test/index/{_63.tii → _9l.tii} +0 -0
  38. data/spec/dummy/solr/data/test/index/{_63.tis → _9l.tis} +0 -0
  39. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  40. data/spec/dummy/solr/data/test/index/segments_j7 +0 -0
  41. data/spec/fixtures/library_groups.yml +34 -0
  42. metadata +64 -64
  43. data/spec/dummy/app/models/role.rb +0 -5
  44. data/spec/dummy/app/models/user_group.rb +0 -2
  45. data/spec/dummy/app/models/user_has_role.rb +0 -4
  46. data/spec/dummy/db/migrate/20081028083142_create_patron_import_files.rb +0 -22
  47. data/spec/dummy/db/migrate/20100606073747_create_patron_relationships.rb +0 -13
  48. data/spec/dummy/db/migrate/20100814091104_add_position_to_patron_relationship.rb +0 -11
  49. data/spec/dummy/db/migrate/20100925074559_create_patron_import_results.rb +0 -12
  50. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +0 -11
  51. data/spec/dummy/db/migrate/20110918161853_rename_series_statement_manifestation_id_to_root_manifestation_id.rb +0 -13
  52. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_patron_import_file.rb +0 -5
  53. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_patron_import_file.rb +0 -5
  54. data/spec/dummy/db/migrate/20120415060323_rename_patron_import_file_imported_at_to_executed_at.rb +0 -9
  55. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_patron_import_file.rb +0 -5
  56. data/spec/dummy/solr/data/test/index/segments_c7 +0 -0
@@ -13,6 +13,125 @@
13
13
 
14
14
  ActiveRecord::Schema.define(:version => 20120602141129) do
15
15
 
16
+ create_table "agent_import_files", :force => true do |t|
17
+ t.integer "parent_id"
18
+ t.string "content_type"
19
+ t.integer "size"
20
+ t.integer "user_id"
21
+ t.text "note"
22
+ t.datetime "executed_at"
23
+ t.string "state"
24
+ t.string "agent_import_file_name"
25
+ t.string "agent_import_content_type"
26
+ t.integer "agent_import_file_size"
27
+ t.datetime "agent_import_updated_at"
28
+ t.datetime "created_at", :null => false
29
+ t.datetime "updated_at", :null => false
30
+ t.string "agent_import_fingerprint"
31
+ t.text "error_message"
32
+ t.string "edit_mode"
33
+ end
34
+
35
+ add_index "agent_import_files", ["parent_id"], :name => "index_agent_import_files_on_parent_id"
36
+ add_index "agent_import_files", ["state"], :name => "index_agent_import_files_on_state"
37
+ add_index "agent_import_files", ["user_id"], :name => "index_agent_import_files_on_user_id"
38
+
39
+ create_table "agent_import_results", :force => true do |t|
40
+ t.integer "agent_import_file_id"
41
+ t.integer "agent_id"
42
+ t.integer "user_id"
43
+ t.text "body"
44
+ t.datetime "created_at", :null => false
45
+ t.datetime "updated_at", :null => false
46
+ end
47
+
48
+ create_table "agent_relationship_types", :force => true do |t|
49
+ t.string "name", :null => false
50
+ t.text "display_name"
51
+ t.text "note"
52
+ t.integer "position"
53
+ t.datetime "created_at", :null => false
54
+ t.datetime "updated_at", :null => false
55
+ end
56
+
57
+ create_table "agent_relationships", :force => true do |t|
58
+ t.integer "parent_id"
59
+ t.integer "child_id"
60
+ t.integer "agent_relationship_type_id"
61
+ t.datetime "created_at", :null => false
62
+ t.datetime "updated_at", :null => false
63
+ t.integer "position"
64
+ end
65
+
66
+ add_index "agent_relationships", ["child_id"], :name => "index_agent_relationships_on_child_id"
67
+ add_index "agent_relationships", ["parent_id"], :name => "index_agent_relationships_on_parent_id"
68
+
69
+ create_table "agent_types", :force => true do |t|
70
+ t.string "name", :null => false
71
+ t.text "display_name"
72
+ t.text "note"
73
+ t.integer "position"
74
+ t.datetime "created_at", :null => false
75
+ t.datetime "updated_at", :null => false
76
+ end
77
+
78
+ create_table "agents", :force => true do |t|
79
+ t.integer "user_id"
80
+ t.string "last_name"
81
+ t.string "middle_name"
82
+ t.string "first_name"
83
+ t.string "last_name_transcription"
84
+ t.string "middle_name_transcription"
85
+ t.string "first_name_transcription"
86
+ t.string "corporate_name"
87
+ t.string "corporate_name_transcription"
88
+ t.string "full_name"
89
+ t.text "full_name_transcription"
90
+ t.text "full_name_alternative"
91
+ t.datetime "created_at", :null => false
92
+ t.datetime "updated_at", :null => false
93
+ t.datetime "deleted_at"
94
+ t.string "zip_code_1"
95
+ t.string "zip_code_2"
96
+ t.text "address_1"
97
+ t.text "address_2"
98
+ t.text "address_1_note"
99
+ t.text "address_2_note"
100
+ t.string "telephone_number_1"
101
+ t.string "telephone_number_2"
102
+ t.string "fax_number_1"
103
+ t.string "fax_number_2"
104
+ t.text "other_designation"
105
+ t.text "place"
106
+ t.string "postal_code"
107
+ t.text "street"
108
+ t.text "locality"
109
+ t.text "region"
110
+ t.datetime "date_of_birth"
111
+ t.datetime "date_of_death"
112
+ t.integer "language_id", :default => 1, :null => false
113
+ t.integer "country_id", :default => 1, :null => false
114
+ t.integer "agent_type_id", :default => 1, :null => false
115
+ t.integer "lock_version", :default => 0, :null => false
116
+ t.text "note"
117
+ t.integer "required_role_id", :default => 1, :null => false
118
+ t.integer "required_score", :default => 0, :null => false
119
+ t.string "state"
120
+ t.text "email"
121
+ t.text "url"
122
+ t.text "full_name_alternative_transcription"
123
+ t.string "birth_date"
124
+ t.string "death_date"
125
+ t.string "agent_identifier"
126
+ end
127
+
128
+ add_index "agents", ["agent_identifier"], :name => "index_agents_on_agent_identifier"
129
+ add_index "agents", ["country_id"], :name => "index_agents_on_country_id"
130
+ add_index "agents", ["full_name"], :name => "index_agents_on_full_name"
131
+ add_index "agents", ["language_id"], :name => "index_agents_on_language_id"
132
+ add_index "agents", ["required_role_id"], :name => "index_agents_on_required_role_id"
133
+ add_index "agents", ["user_id"], :name => "index_agents_on_user_id", :unique => true
134
+
16
135
  create_table "answer_has_items", :force => true do |t|
17
136
  t.integer "answer_id"
18
137
  t.integer "item_id"
@@ -83,7 +202,7 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
83
202
  end
84
203
 
85
204
  create_table "creates", :force => true do |t|
86
- t.integer "patron_id", :null => false
205
+ t.integer "agent_id", :null => false
87
206
  t.integer "work_id", :null => false
88
207
  t.integer "position"
89
208
  t.datetime "created_at", :null => false
@@ -91,18 +210,18 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
91
210
  t.integer "create_type_id"
92
211
  end
93
212
 
94
- add_index "creates", ["patron_id"], :name => "index_creates_on_patron_id"
213
+ add_index "creates", ["agent_id"], :name => "index_creates_on_agent_id"
95
214
  add_index "creates", ["work_id"], :name => "index_creates_on_work_id"
96
215
 
97
216
  create_table "donates", :force => true do |t|
98
- t.integer "patron_id", :null => false
217
+ t.integer "agent_id", :null => false
99
218
  t.integer "item_id", :null => false
100
219
  t.datetime "created_at", :null => false
101
220
  t.datetime "updated_at", :null => false
102
221
  end
103
222
 
223
+ add_index "donates", ["agent_id"], :name => "index_donates_on_agent_id"
104
224
  add_index "donates", ["item_id"], :name => "index_donates_on_item_id"
105
- add_index "donates", ["patron_id"], :name => "index_donates_on_patron_id"
106
225
 
107
226
  create_table "exemplifies", :force => true do |t|
108
227
  t.integer "manifestation_id", :null => false
@@ -158,28 +277,24 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
158
277
  create_table "items", :force => true do |t|
159
278
  t.string "call_number"
160
279
  t.string "item_identifier"
161
- t.integer "circulation_status_id", :default => 5, :null => false
162
- t.integer "checkout_type_id", :default => 1, :null => false
163
- t.datetime "created_at", :null => false
164
- t.datetime "updated_at", :null => false
280
+ t.datetime "created_at", :null => false
281
+ t.datetime "updated_at", :null => false
165
282
  t.datetime "deleted_at"
166
- t.integer "shelf_id", :default => 1, :null => false
167
- t.boolean "include_supplements", :default => false, :null => false
283
+ t.integer "shelf_id", :default => 1, :null => false
284
+ t.boolean "include_supplements", :default => false, :null => false
168
285
  t.text "note"
169
286
  t.string "url"
170
287
  t.integer "price"
171
- t.integer "lock_version", :default => 0, :null => false
172
- t.integer "required_role_id", :default => 1, :null => false
288
+ t.integer "lock_version", :default => 0, :null => false
289
+ t.integer "required_role_id", :default => 1, :null => false
173
290
  t.string "state"
174
- t.integer "required_score", :default => 0, :null => false
291
+ t.integer "required_score", :default => 0, :null => false
175
292
  t.datetime "acquired_at"
176
293
  t.integer "bookstore_id"
177
294
  t.integer "budget_type_id"
178
295
  end
179
296
 
180
297
  add_index "items", ["bookstore_id"], :name => "index_items_on_bookstore_id"
181
- add_index "items", ["checkout_type_id"], :name => "index_items_on_checkout_type_id"
182
- add_index "items", ["circulation_status_id"], :name => "index_items_on_circulation_status_id"
183
298
  add_index "items", ["item_identifier"], :name => "index_items_on_item_identifier"
184
299
  add_index "items", ["required_role_id"], :name => "index_items_on_required_role_id"
185
300
  add_index "items", ["shelf_id"], :name => "index_items_on_shelf_id"
@@ -200,6 +315,24 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
200
315
  add_index "languages", ["iso_639_3"], :name => "index_languages_on_iso_639_3"
201
316
  add_index "languages", ["name"], :name => "index_languages_on_name", :unique => true
202
317
 
318
+ create_table "library_groups", :force => true do |t|
319
+ t.string "name", :null => false
320
+ t.text "display_name"
321
+ t.string "short_name", :null => false
322
+ t.string "email"
323
+ t.text "my_networks"
324
+ t.text "login_banner"
325
+ t.text "note"
326
+ t.integer "country_id"
327
+ t.integer "position"
328
+ t.datetime "created_at", :null => false
329
+ t.datetime "updated_at", :null => false
330
+ t.text "admin_networks"
331
+ t.string "url", :default => "http://localhost:3000/"
332
+ end
333
+
334
+ add_index "library_groups", ["short_name"], :name => "index_library_groups_on_short_name"
335
+
203
336
  create_table "licenses", :force => true do |t|
204
337
  t.string "name", :null => false
205
338
  t.string "display_name"
@@ -317,132 +450,15 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
317
450
  end
318
451
 
319
452
  create_table "owns", :force => true do |t|
320
- t.integer "patron_id", :null => false
453
+ t.integer "agent_id", :null => false
321
454
  t.integer "item_id", :null => false
322
455
  t.integer "position"
323
456
  t.datetime "created_at", :null => false
324
457
  t.datetime "updated_at", :null => false
325
458
  end
326
459
 
460
+ add_index "owns", ["agent_id"], :name => "index_owns_on_agent_id"
327
461
  add_index "owns", ["item_id"], :name => "index_owns_on_item_id"
328
- add_index "owns", ["patron_id"], :name => "index_owns_on_patron_id"
329
-
330
- create_table "patron_import_files", :force => true do |t|
331
- t.integer "parent_id"
332
- t.string "content_type"
333
- t.integer "size"
334
- t.integer "user_id"
335
- t.text "note"
336
- t.datetime "executed_at"
337
- t.string "state"
338
- t.string "patron_import_file_name"
339
- t.string "patron_import_content_type"
340
- t.integer "patron_import_file_size"
341
- t.datetime "patron_import_updated_at"
342
- t.datetime "created_at", :null => false
343
- t.datetime "updated_at", :null => false
344
- t.string "patron_import_fingerprint"
345
- t.text "error_message"
346
- t.string "edit_mode"
347
- end
348
-
349
- add_index "patron_import_files", ["parent_id"], :name => "index_patron_import_files_on_parent_id"
350
- add_index "patron_import_files", ["state"], :name => "index_patron_import_files_on_state"
351
- add_index "patron_import_files", ["user_id"], :name => "index_patron_import_files_on_user_id"
352
-
353
- create_table "patron_import_results", :force => true do |t|
354
- t.integer "patron_import_file_id"
355
- t.integer "patron_id"
356
- t.integer "user_id"
357
- t.text "body"
358
- t.datetime "created_at", :null => false
359
- t.datetime "updated_at", :null => false
360
- end
361
-
362
- create_table "patron_relationship_types", :force => true do |t|
363
- t.string "name", :null => false
364
- t.text "display_name"
365
- t.text "note"
366
- t.integer "position"
367
- t.datetime "created_at", :null => false
368
- t.datetime "updated_at", :null => false
369
- end
370
-
371
- create_table "patron_relationships", :force => true do |t|
372
- t.integer "parent_id"
373
- t.integer "child_id"
374
- t.integer "patron_relationship_type_id"
375
- t.datetime "created_at", :null => false
376
- t.datetime "updated_at", :null => false
377
- t.integer "position"
378
- end
379
-
380
- add_index "patron_relationships", ["child_id"], :name => "index_patron_relationships_on_child_id"
381
- add_index "patron_relationships", ["parent_id"], :name => "index_patron_relationships_on_parent_id"
382
-
383
- create_table "patron_types", :force => true do |t|
384
- t.string "name", :null => false
385
- t.text "display_name"
386
- t.text "note"
387
- t.integer "position"
388
- t.datetime "created_at", :null => false
389
- t.datetime "updated_at", :null => false
390
- end
391
-
392
- create_table "patrons", :force => true do |t|
393
- t.integer "user_id"
394
- t.string "last_name"
395
- t.string "middle_name"
396
- t.string "first_name"
397
- t.string "last_name_transcription"
398
- t.string "middle_name_transcription"
399
- t.string "first_name_transcription"
400
- t.string "corporate_name"
401
- t.string "corporate_name_transcription"
402
- t.string "full_name"
403
- t.text "full_name_transcription"
404
- t.text "full_name_alternative"
405
- t.datetime "created_at", :null => false
406
- t.datetime "updated_at", :null => false
407
- t.datetime "deleted_at"
408
- t.string "zip_code_1"
409
- t.string "zip_code_2"
410
- t.text "address_1"
411
- t.text "address_2"
412
- t.text "address_1_note"
413
- t.text "address_2_note"
414
- t.string "telephone_number_1"
415
- t.string "telephone_number_2"
416
- t.string "fax_number_1"
417
- t.string "fax_number_2"
418
- t.text "other_designation"
419
- t.text "place"
420
- t.string "postal_code"
421
- t.text "street"
422
- t.text "locality"
423
- t.text "region"
424
- t.datetime "date_of_birth"
425
- t.datetime "date_of_death"
426
- t.integer "language_id", :default => 1, :null => false
427
- t.integer "country_id", :default => 1, :null => false
428
- t.integer "patron_type_id", :default => 1, :null => false
429
- t.integer "lock_version", :default => 0, :null => false
430
- t.text "note"
431
- t.integer "required_role_id", :default => 1, :null => false
432
- t.integer "required_score", :default => 0, :null => false
433
- t.string "state"
434
- t.text "email"
435
- t.text "url"
436
- t.text "full_name_alternative_transcription"
437
- t.string "birth_date"
438
- t.string "death_date"
439
- end
440
-
441
- add_index "patrons", ["country_id"], :name => "index_patrons_on_country_id"
442
- add_index "patrons", ["full_name"], :name => "index_patrons_on_full_name"
443
- add_index "patrons", ["language_id"], :name => "index_patrons_on_language_id"
444
- add_index "patrons", ["required_role_id"], :name => "index_patrons_on_required_role_id"
445
- add_index "patrons", ["user_id"], :name => "index_patrons_on_user_id", :unique => true
446
462
 
447
463
  create_table "picture_files", :force => true do |t|
448
464
  t.integer "picture_attachable_id"
@@ -473,7 +489,7 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
473
489
  end
474
490
 
475
491
  create_table "produces", :force => true do |t|
476
- t.integer "patron_id", :null => false
492
+ t.integer "agent_id", :null => false
477
493
  t.integer "manifestation_id", :null => false
478
494
  t.integer "position"
479
495
  t.datetime "created_at", :null => false
@@ -481,8 +497,8 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
481
497
  t.integer "produce_type_id"
482
498
  end
483
499
 
500
+ add_index "produces", ["agent_id"], :name => "index_produces_on_agent_id"
484
501
  add_index "produces", ["manifestation_id"], :name => "index_produces_on_manifestation_id"
485
- add_index "produces", ["patron_id"], :name => "index_produces_on_patron_id"
486
502
 
487
503
  create_table "questions", :force => true do |t|
488
504
  t.integer "user_id", :null => false
@@ -509,7 +525,7 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
509
525
  end
510
526
 
511
527
  create_table "realizes", :force => true do |t|
512
- t.integer "patron_id", :null => false
528
+ t.integer "agent_id", :null => false
513
529
  t.integer "expression_id", :null => false
514
530
  t.integer "position"
515
531
  t.datetime "created_at", :null => false
@@ -517,8 +533,8 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
517
533
  t.integer "realize_type_id"
518
534
  end
519
535
 
536
+ add_index "realizes", ["agent_id"], :name => "index_realizes_on_agent_id"
520
537
  add_index "realizes", ["expression_id"], :name => "index_realizes_on_expression_id"
521
- add_index "realizes", ["patron_id"], :name => "index_realizes_on_patron_id"
522
538
 
523
539
  create_table "resource_import_files", :force => true do |t|
524
540
  t.integer "parent_id"
@@ -605,12 +621,12 @@ ActiveRecord::Schema.define(:version => 20120602141129) do
605
621
  t.string "series_statement_identifier"
606
622
  t.string "issn"
607
623
  t.boolean "periodical"
608
- t.integer "root_manifestation_id"
624
+ t.integer "manifestation_id"
609
625
  t.text "note"
610
626
  t.text "title_subseries_transcription"
611
627
  end
612
628
 
613
- add_index "series_statements", ["root_manifestation_id"], :name => "index_series_statements_on_manifestation_id"
629
+ add_index "series_statements", ["manifestation_id"], :name => "index_series_statements_on_manifestation_id"
614
630
  add_index "series_statements", ["series_statement_identifier"], :name => "index_series_statements_on_series_statement_identifier"
615
631
 
616
632
  create_table "taggings", :force => true do |t|
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
+