enju_question 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. data/app/views/answers/index.html.erb +1 -1
  2. data/app/views/questions/_list.html.erb +2 -2
  3. data/lib/enju_question/engine.rb +1 -6
  4. data/lib/enju_question/version.rb +1 -1
  5. data/spec/cassette_library/enju_ndl/crd.yml +8 -95
  6. data/spec/dummy/config/application.rb +2 -1
  7. data/spec/dummy/config/initializers/mime_types.rb +0 -1
  8. data/spec/dummy/db/development.sqlite3 +0 -0
  9. data/spec/dummy/db/migrate/001_create_patrons.rb +53 -0
  10. data/spec/dummy/db/migrate/005_create_manifestations.rb +56 -0
  11. data/spec/dummy/db/migrate/006_create_items.rb +1 -9
  12. data/spec/dummy/db/migrate/012_create_owns.rb +12 -0
  13. data/spec/dummy/db/migrate/015_create_creates.rb +12 -0
  14. data/spec/dummy/db/migrate/047_create_produces.rb +12 -0
  15. data/spec/dummy/db/migrate/073_create_carrier_types.rb +11 -0
  16. data/spec/dummy/db/migrate/112_create_frequencies.rb +12 -0
  17. data/spec/dummy/db/migrate/117_create_form_of_works.rb +12 -0
  18. data/spec/dummy/db/migrate/125_create_donates.rb +12 -0
  19. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +13 -0
  20. data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +13 -0
  21. data/spec/dummy/db/migrate/20080905191442_create_patron_types.rb +12 -0
  22. data/spec/dummy/db/migrate/20081025083323_create_countries.rb +28 -0
  23. data/spec/dummy/db/migrate/20081025083905_create_languages.rb +23 -0
  24. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +15 -0
  25. data/spec/dummy/db/migrate/20081028083142_create_patron_import_files.rb +22 -0
  26. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +22 -0
  27. data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +15 -0
  28. data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +15 -0
  29. data/spec/dummy/db/migrate/20090719201843_create_extents.rb +12 -0
  30. data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +12 -0
  31. data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +12 -0
  32. data/spec/dummy/db/migrate/20090812151902_create_patron_relationship_types.rb +12 -0
  33. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +27 -0
  34. data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +12 -0
  35. data/spec/dummy/db/migrate/20091202124834_create_versions.rb +18 -0
  36. data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +13 -0
  37. data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +15 -0
  38. data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +13 -0
  39. data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +10 -0
  40. data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +13 -0
  41. data/spec/dummy/db/migrate/20100606073747_create_patron_relationships.rb +13 -0
  42. data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +12 -0
  43. data/spec/dummy/db/migrate/20100814091104_add_position_to_patron_relationship.rb +11 -0
  44. data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +15 -0
  45. data/spec/dummy/db/migrate/20100925074559_create_patron_import_results.rb +12 -0
  46. data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +9 -0
  47. data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +9 -0
  48. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +11 -0
  49. data/spec/dummy/db/migrate/20110425133109_add_issn_to_series_statement.rb +9 -0
  50. data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +9 -0
  51. data/spec/dummy/db/migrate/20110618091240_add_periodical_to_series_statement.rb +9 -0
  52. data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +9 -0
  53. data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +11 -0
  54. data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +9 -0
  55. data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +12 -0
  56. data/spec/dummy/db/migrate/20110820131417_create_series_has_manifestations.rb +13 -0
  57. data/spec/dummy/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +13 -0
  58. data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +13 -0
  59. data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +10 -0
  60. data/spec/dummy/db/migrate/20110918161853_rename_series_statement_manifestation_id_to_root_manifestation_id.rb +13 -0
  61. data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +9 -0
  62. data/spec/dummy/db/migrate/20111009183423_add_ndc_to_manifestation.rb +9 -0
  63. data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +12 -0
  64. data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +12 -0
  65. data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +12 -0
  66. data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +7 -0
  67. data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +6 -0
  68. data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +6 -0
  69. data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +6 -0
  70. data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +5 -0
  71. data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +5 -0
  72. data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +5 -0
  73. data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +5 -0
  74. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_patron_import_file.rb +5 -0
  75. data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +5 -0
  76. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_patron_import_file.rb +5 -0
  77. data/spec/dummy/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +9 -0
  78. data/spec/dummy/db/migrate/20120415060323_rename_patron_import_file_imported_at_to_executed_at.rb +9 -0
  79. data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +5 -0
  80. data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +5 -0
  81. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_patron_import_file.rb +5 -0
  82. data/spec/dummy/db/schema.rb +536 -18
  83. data/spec/dummy/db/test.sqlite3 +0 -0
  84. data/spec/dummy/solr/data/test/index/_0.fdt +0 -0
  85. data/spec/dummy/solr/data/test/index/_0.fdx +0 -0
  86. data/spec/dummy/solr/data/test/index/_0.fnm +3 -0
  87. data/spec/dummy/solr/data/test/index/_0.frq +1 -0
  88. data/spec/dummy/solr/data/test/index/_0.nrm +1 -0
  89. data/spec/dummy/solr/data/test/index/_0.prx +0 -0
  90. data/spec/dummy/solr/data/test/index/_0.tii +0 -0
  91. data/spec/dummy/solr/data/test/index/_0.tis +0 -0
  92. data/spec/dummy/solr/data/test/index/_0_1.del +0 -0
  93. data/spec/dummy/solr/data/test/index/_1.fdt +0 -0
  94. data/spec/dummy/solr/data/test/index/_1.fdx +0 -0
  95. data/spec/dummy/solr/data/test/index/_1.fnm +3 -0
  96. data/spec/dummy/solr/data/test/index/_1.frq +1 -0
  97. data/spec/dummy/solr/data/test/index/_1.nrm +1 -0
  98. data/spec/dummy/solr/data/test/index/_1.prx +0 -0
  99. data/spec/dummy/solr/data/test/index/_1.tii +0 -0
  100. data/spec/dummy/solr/data/test/index/_1.tis +0 -0
  101. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  102. data/spec/dummy/solr/data/test/index/segments_3 +0 -0
  103. data/spec/dummy/solr/data/test/spellchecker/segments_1 +0 -0
  104. metadata +224 -18
  105. data/spec/dummy/app/models/item.rb +0 -5
  106. data/spec/dummy/db/migrate/20111201121636_create_languages.rb +0 -16
  107. data/spec/dummy/lib/expire_editable_fragment.rb +0 -62
  108. data/spec/dummy/solr/data/test/index/segments_1 +0 -0
@@ -1,62 +0,0 @@
1
- module ExpireEditableFragment
2
- def expire_editable_fragment(record, fragments = [], formats = [])
3
- fragments.uniq!
4
- fragments = ['detail'] if fragments.empty?
5
- if record
6
- if record.is_a?(Manifestation)
7
- expire_manifestation_cache(record, fragments, formats)
8
- else
9
- I18n.available_locales.each do |locale|
10
- Role.all_cache.each do |role|
11
- fragments.each do |fragment|
12
- expire_fragment(:controller => record.class.to_s.pluralize.downcase, :action => :show, :id => record.id, :page => fragment, :role => role.name, :locale => locale)
13
- end
14
- end
15
- end
16
- end
17
- end
18
- end
19
-
20
- def expire_manifestation_cache(manifestation, fragments = [], formats = [])
21
- fragments = %w[detail pickup title show_list show_index sru] if fragments.size == 1 and fragments.first == 'detail'
22
- expire_fragment(:controller => :manifestations, :action => :index, :page => 'numdocs')
23
- fragments.uniq.each do |fragment|
24
- expire_manifestation_fragment(manifestation, fragment, formats)
25
- end
26
- if defined?(EnjuBookmark)
27
- manifestation.bookmarks.each do |bookmark|
28
- expire_tag_cloud(bookmark)
29
- end
30
- end
31
- end
32
-
33
- def expire_manifestation_fragment(manifestation, fragment, formats = [])
34
- formats = ['atom', 'csv', 'html', 'mods', 'mobile', 'oai_list_identifiers', 'oai_list_records', 'rdf', 'rss'] if formats.empty?
35
- if manifestation
36
- I18n.available_locales.each do |locale|
37
- if fragment == 'holding'
38
- expire_fragment(:controller => :manifestations, :action => :show, :id => manifestation.id, :page => fragment, :locale => locale, :manifestation_id => nil)
39
- formats.each do |format|
40
- expire_fragment(:controller => :manifestations, :action => :show, :id => manifestation.id, :page => fragment, :locale => locale, :format => format, :manifestation_id => nil)
41
- end
42
- else
43
- Role.all_cache.each do |role|
44
- expire_fragment(:controller => :manifestations, :action => :show, :id => manifestation.id, :page => fragment, :role => role.name, :locale => locale, :manifestation_id => nil)
45
- formats.each do |format|
46
- expire_fragment(:controller => :manifestations, :action => :show, :id => manifestation.id, :page => fragment, :role => role.name, :locale => locale, :format => format, :manifestation_id => nil)
47
- end
48
- end
49
- end
50
- end
51
- end
52
- end
53
-
54
- def expire_tag_cloud(bookmark)
55
- I18n.available_locales.each do |locale|
56
- Role.all_cache.each do |role|
57
- expire_fragment(:controller => :tags, :action => :index, :page => 'user_tag_cloud', :user_id => bookmark.user.username, :locale => locale, :role => role.name, :user_id => nil)
58
- expire_fragment(:controller => :tags, :action => :index, :page => 'public_tag_cloud', :locale => locale, :role => role.name, :user_id => nil)
59
- end
60
- end
61
- end
62
- end