blacklight-spotlight 0.34.1 → 1.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/javascripts/spotlight/pages.js.erb +1 -1
  4. data/app/controllers/concerns/spotlight/controller.rb +0 -12
  5. data/app/helpers/spotlight/crop_helper.rb +1 -5
  6. data/app/models/concerns/spotlight/resources/open_graph.rb +1 -5
  7. data/app/models/concerns/spotlight/solr_document.rb +20 -23
  8. data/app/models/concerns/spotlight/solr_document/finder.rb +16 -0
  9. data/app/models/spotlight/blacklight_configuration.rb +5 -11
  10. data/app/models/spotlight/contact.rb +2 -2
  11. data/app/models/spotlight/custom_field.rb +1 -1
  12. data/app/models/spotlight/exhibit.rb +3 -3
  13. data/app/models/spotlight/feature_page.rb +2 -2
  14. data/app/models/spotlight/field_metadata.rb +12 -4
  15. data/app/models/spotlight/filter.rb +1 -8
  16. data/app/models/spotlight/lock.rb +1 -1
  17. data/app/models/spotlight/page.rb +3 -3
  18. data/app/models/spotlight/reindexing_log_entry.rb +1 -1
  19. data/app/models/spotlight/resource.rb +1 -1
  20. data/app/models/spotlight/resources/upload.rb +1 -1
  21. data/app/models/spotlight/role.rb +4 -11
  22. data/app/models/spotlight/search.rb +2 -2
  23. data/app/models/spotlight/site.rb +1 -1
  24. data/app/models/spotlight/solr_document_sidecar.rb +5 -1
  25. data/app/uploaders/spotlight/featured_image_uploader.rb +1 -1
  26. data/app/views/shared/_exhibit_navbar.html.erb +1 -1
  27. data/app/views/spotlight/catalog/_edit_default.html.erb +1 -1
  28. data/db/migrate/20131119213142_create_spotlight_pages.rb +1 -1
  29. data/db/migrate/20131120172811_create_spotlight_attachments.rb +1 -1
  30. data/db/migrate/20140128155151_create_exhibits.rb +1 -1
  31. data/db/migrate/20140128155152_create_roles.rb +1 -1
  32. data/db/migrate/20140130155151_create_spotlight_searches.rb +1 -1
  33. data/db/migrate/20140130215634_create_spotlight_blacklight_configurations.rb +1 -1
  34. data/db/migrate/20140206152809_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +1 -1
  35. data/db/migrate/20140206152810_add_missing_unique_indices.acts_as_taggable_on_engine.rb +1 -1
  36. data/db/migrate/20140211203403_create_spotlight_custom_fields.rb +1 -1
  37. data/db/migrate/20140211212626_create_spotlight_solr_document_sidecars.rb +1 -1
  38. data/db/migrate/20140218155151_create_contacts.rb +1 -1
  39. data/db/migrate/20140225180948_create_contact_emails.rb +1 -1
  40. data/db/migrate/20140228131207_create_resources.rb +1 -1
  41. data/db/migrate/20140401232956_change_featured_image_to_featured_image_id.rb +1 -1
  42. data/db/migrate/20140403180324_create_spotlight_main_navigations.rb +1 -1
  43. data/db/migrate/20141117111311_create_locks.rb +1 -1
  44. data/db/migrate/20141118233735_change_contact_details.rb +1 -1
  45. data/db/migrate/20141126231820_add_avatar_to_contacts.rb +1 -1
  46. data/db/migrate/20141205005902_add_layout_options_to_exhibit.rb +1 -1
  47. data/db/migrate/20150116161616_add_published_to_exhibit.rb +1 -1
  48. data/db/migrate/20150127173245_add_featured_image_to_exhibit.rb +1 -1
  49. data/db/migrate/20150217111511_add_polymorphic_document_to_sidecars.rb +1 -1
  50. data/db/migrate/20150304071512_add_spotlight_featured_images.rb +1 -1
  51. data/db/migrate/20150304111111_add_featured_image_to_spotlight_classes.rb +1 -1
  52. data/db/migrate/20150306202300_add_display_to_spotlight_main_navigations.rb +1 -1
  53. data/db/migrate/20150313175432_add_field_type_to_custom_fields.rb +1 -1
  54. data/db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +1 -1
  55. data/db/migrate/20150410180015_add_missing_taggable_index.acts_as_taggable_on_engine.rb +1 -1
  56. data/db/migrate/20150410180016_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +1 -1
  57. data/db/migrate/20150713160101_change_spotlight_searches_to_published.rb +1 -1
  58. data/db/migrate/20151016092343_remove_searchable_from_exhibit.rb +1 -1
  59. data/db/migrate/20151110082345_add_metadata_to_spotlight_resource.rb +1 -1
  60. data/db/migrate/20151117153210_change_spotlight_exhibit_published_default.rb +1 -1
  61. data/db/migrate/20151124101123_remove_default_from_spotlight_exhibit.rb +1 -1
  62. data/db/migrate/20151124105543_update_custom_field_names.rb +1 -1
  63. data/db/migrate/20151208085432_add_weight_to_exhibits.rb +1 -1
  64. data/db/migrate/20151210073829_create_spotlight_site.rb +1 -1
  65. data/db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb +1 -1
  66. data/db/migrate/20151215141516_change_roles_to_support_polymorphic_associations.rb +1 -1
  67. data/db/migrate/20151215192845_add_index_status_to_resources.rb +1 -1
  68. data/db/migrate/20151217211019_create_spotlight_exhibit_filters.rb +1 -1
  69. data/db/migrate/20160329215014_add_readonly_to_custom_fields.rb +1 -1
  70. data/db/migrate/20160711121314_add_default_view_to_spotlight_searches.rb +1 -1
  71. data/db/migrate/20160714144125_add_iiif_urls_to_featured_image.rb +1 -1
  72. data/db/migrate/20160718194010_add_iiif_url_to_contact.rb +1 -1
  73. data/db/migrate/20160805143841_add_upload_id_to_resources.rb +1 -1
  74. data/db/migrate/20160815165432_add_resource_to_solr_document_sidecar.rb +1 -1
  75. data/db/migrate/20160816165432_add_index_status_to_solr_document_sidecar.rb +1 -1
  76. data/db/migrate/20160929180534_add_document_index_to_solr_document_sidecar.rb +1 -1
  77. data/db/migrate/20170105222939_create_spotlight_reindexing_log_entries.rb +1 -1
  78. data/db/migrate/20170204091234_add_theme_to_spotlight_exhibits.rb +1 -1
  79. data/db/migrate/20170803152134_migrate_tags_to_sidecars.rb +17 -0
  80. data/lib/spotlight/version.rb +1 -1
  81. data/spec/controllers/spotlight/appearances_controller_spec.rb +4 -11
  82. data/spec/controllers/spotlight/catalog_controller_spec.rb +5 -3
  83. data/spec/controllers/spotlight/solr_controller_spec.rb +1 -1
  84. data/spec/controllers/spotlight/tags_controller_spec.rb +1 -1
  85. data/spec/examples.txt +1133 -1135
  86. data/spec/features/add_custom_field_metadata_spec.rb +1 -1
  87. data/spec/features/add_iiif_manifest_spec.rb +1 -1
  88. data/spec/features/add_items_spec.rb +6 -2
  89. data/spec/features/autocomplete_typeahead_spec.rb +1 -0
  90. data/spec/features/exhibit_themes_spec.rb +1 -1
  91. data/spec/features/tags_admin_spec.rb +1 -1
  92. data/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb +8 -2
  93. data/spec/models/solr_document_spec.rb +5 -5
  94. data/spec/models/spotlight/blacklight_configuration_spec.rb +3 -2
  95. data/spec/models/spotlight/contact_spec.rb +6 -0
  96. data/spec/models/spotlight/exhibit_spec.rb +0 -10
  97. data/spec/models/spotlight/field_metadata_spec.rb +4 -4
  98. data/spec/models/spotlight/reindexing_log_entry_spec.rb +1 -9
  99. data/spec/models/spotlight/resource_spec.rb +2 -0
  100. data/spec/models/spotlight/role_spec.rb +1 -1
  101. data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +3 -9
  102. data/spec/services/spotlight/solr_document_builder_spec.rb +2 -2
  103. data/spec/spec_helper.rb +2 -6
  104. data/spec/support/helpers/controller_level_helpers.rb +0 -2
  105. data/spec/test_app_templates/fixture.css +0 -0
  106. data/spec/test_app_templates/fixture.png +0 -0
  107. data/spec/test_app_templates/lib/generators/test_app_generator.rb +14 -0
  108. data/spec/uploaders/spotlight/featured_image_uploader_spec.rb +2 -2
  109. data/spec/views/spotlight/searches/edit.html.erb_spec.rb +2 -0
  110. data/spec/views/spotlight/tags/index.html.erb_spec.rb +2 -2
  111. metadata +18 -29
  112. data/app/models/concerns/spotlight/ar_light.rb +0 -86
  113. data/app/models/concerns/spotlight/solr_document/active_model_concern.rb +0 -37
  114. data/spec/support/backport_test_helpers.rb +0 -45
@@ -5,7 +5,7 @@ module Spotlight
5
5
  has_many :exhibits, -> { ordered_by_weight }
6
6
  has_many :roles, as: :resource
7
7
 
8
- belongs_to :masthead, dependent: :destroy
8
+ belongs_to :masthead, dependent: :destroy, optional: true
9
9
 
10
10
  accepts_nested_attributes_for :masthead, update_only: true
11
11
  accepts_nested_attributes_for :exhibits
@@ -2,8 +2,12 @@ module Spotlight
2
2
  ##
3
3
  # Exhibit-specific metadata for indexed documents
4
4
  class SolrDocumentSidecar < ActiveRecord::Base
5
+ extend ActsAsTaggableOn::Taggable
6
+
7
+ acts_as_taggable
8
+
5
9
  belongs_to :exhibit, required: true
6
- belongs_to :resource
10
+ belongs_to :resource, optional: true
7
11
  belongs_to :document, required: true, polymorphic: true
8
12
  serialize :data, Hash
9
13
  serialize :index_status, Hash
@@ -4,7 +4,7 @@ module Spotlight
4
4
  class FeaturedImageUploader < CarrierWave::Uploader::Base
5
5
  storage Spotlight::Engine.config.uploader_storage
6
6
 
7
- def extension_white_list
7
+ def extension_whitelist
8
8
  Spotlight::Engine.config.allowed_upload_extensions
9
9
  end
10
10
 
@@ -5,7 +5,7 @@
5
5
  <% end %>
6
6
 
7
7
  <ul class="nav navbar-nav">
8
- <li class="<%= "active" if current_page?(current_exhibit) %>"><%= link_to t(:'spotlight.curation.nav.home'), current_exhibit %></li>
8
+ <li class="<%= "active" if current_page?([spotlight, current_exhibit]) %>"><%= link_to t(:'spotlight.curation.nav.home'), [spotlight, current_exhibit] %></li>
9
9
  <% current_exhibit.main_navigations.displayable.each do |navigation| %>
10
10
  <%= render partial: "shared/#{navigation.nav_type}_navbar", locals: { navigation: navigation } %>
11
11
  <% end %>
@@ -37,7 +37,7 @@
37
37
 
38
38
  <% if can? :tag, current_exhibit %>
39
39
  <div class="edit-tags">
40
- <%= f.text_field :exhibit_tag_list, value: f.object.tags_from(current_exhibit).to_s, 'data-autocomplete_url' => exhibit_tags_path(current_exhibit, format: 'json') %>
40
+ <%= f.text_field :exhibit_tag_list, value: f.object.sidecar(current_exhibit).tags_from(current_exhibit).to_s, 'data-autocomplete_url' => exhibit_tags_path(current_exhibit, format: 'json') %>
41
41
  </div>
42
42
  <% end %>
43
43
  <div class="form-actions">
@@ -1,4 +1,4 @@
1
- class CreateSpotlightPages < ActiveRecord::Migration
1
+ class CreateSpotlightPages < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_pages do |t|
4
4
  t.string :title
@@ -1,4 +1,4 @@
1
- class CreateSpotlightAttachments < ActiveRecord::Migration
1
+ class CreateSpotlightAttachments < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_attachments do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreateExhibits < ActiveRecord::Migration
1
+ class CreateExhibits < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_exhibits do |t|
4
4
  t.string :title, null: false
@@ -1,4 +1,4 @@
1
- class CreateRoles < ActiveRecord::Migration
1
+ class CreateRoles < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_roles do |t|
4
4
  t.references :exhibit
@@ -1,4 +1,4 @@
1
- class CreateSpotlightSearches < ActiveRecord::Migration
1
+ class CreateSpotlightSearches < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_searches do |t|
4
4
  t.string :title
@@ -1,4 +1,4 @@
1
- class CreateSpotlightBlacklightConfigurations < ActiveRecord::Migration
1
+ class CreateSpotlightBlacklightConfigurations < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_blacklight_configurations do |t|
4
4
  t.references :exhibit
@@ -1,5 +1,5 @@
1
1
  # This migration comes from acts_as_taggable_on_engine (originally 1)
2
- class ActsAsTaggableOnMigration < ActiveRecord::Migration
2
+ class ActsAsTaggableOnMigration < ActiveRecord::Migration[4.2]
3
3
  def self.up
4
4
  create_table :tags do |t|
5
5
  t.string :name
@@ -1,5 +1,5 @@
1
1
  # This migration comes from acts_as_taggable_on_engine (originally 2)
2
- class AddMissingUniqueIndices < ActiveRecord::Migration
2
+ class AddMissingUniqueIndices < ActiveRecord::Migration[4.2]
3
3
 
4
4
  def self.up
5
5
  add_index :tags, :name, unique: true
@@ -1,4 +1,4 @@
1
- class CreateSpotlightCustomFields < ActiveRecord::Migration
1
+ class CreateSpotlightCustomFields < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_custom_fields do |t|
4
4
  t.references :exhibit
@@ -1,4 +1,4 @@
1
- class CreateSpotlightSolrDocumentSidecars < ActiveRecord::Migration
1
+ class CreateSpotlightSolrDocumentSidecars < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_solr_document_sidecars do |t|
4
4
  t.references :exhibit, index: true
@@ -1,4 +1,4 @@
1
- class CreateContacts < ActiveRecord::Migration
1
+ class CreateContacts < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_contacts do |t|
4
4
  t.string :slug
@@ -1,4 +1,4 @@
1
- class CreateContactEmails < ActiveRecord::Migration
1
+ class CreateContactEmails < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table(:spotlight_contact_emails) do |t|
4
4
  t.references :exhibit
@@ -1,4 +1,4 @@
1
- class CreateResources < ActiveRecord::Migration
1
+ class CreateResources < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table(:spotlight_resources) do |t|
4
4
  t.references :exhibit
@@ -1,4 +1,4 @@
1
- class ChangeFeaturedImageToFeaturedImageId < ActiveRecord::Migration
1
+ class ChangeFeaturedImageToFeaturedImageId < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  remove_column :spotlight_searches, :featured_image, :string
4
4
  add_column :spotlight_searches, :featured_item_id, :string
@@ -1,4 +1,4 @@
1
- class CreateSpotlightMainNavigations < ActiveRecord::Migration
1
+ class CreateSpotlightMainNavigations < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_main_navigations do |t|
4
4
  t.string :label
@@ -1,4 +1,4 @@
1
- class CreateLocks < ActiveRecord::Migration
1
+ class CreateLocks < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_locks do |t|
4
4
  t.references :on, polymorphic: true
@@ -1,4 +1,4 @@
1
- class ChangeContactDetails < ActiveRecord::Migration
1
+ class ChangeContactDetails < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_column :spotlight_contacts, :contact_info, :text
4
4
 
@@ -1,4 +1,4 @@
1
- class AddAvatarToContacts < ActiveRecord::Migration
1
+ class AddAvatarToContacts < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spotlight_contacts, :avatar, :string
4
4
  add_column :spotlight_contacts, :avatar_crop_x, :integer
@@ -1,4 +1,4 @@
1
- class AddLayoutOptionsToExhibit < ActiveRecord::Migration
1
+ class AddLayoutOptionsToExhibit < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spotlight_exhibits, :searchable, :boolean, default: true
4
4
  add_column :spotlight_exhibits, :layout, :string
@@ -1,4 +1,4 @@
1
- class AddPublishedToExhibit < ActiveRecord::Migration
1
+ class AddPublishedToExhibit < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spotlight_exhibits, :published, :boolean, default: false
4
4
  add_column :spotlight_exhibits, :published_at, :datetime
@@ -1,4 +1,4 @@
1
- class AddFeaturedImageToExhibit < ActiveRecord::Migration
1
+ class AddFeaturedImageToExhibit < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spotlight_exhibits, :featured_image, :string
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddPolymorphicDocumentToSidecars < ActiveRecord::Migration
1
+ class AddPolymorphicDocumentToSidecars < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spotlight_solr_document_sidecars, :document_id, :string
4
4
  add_column :spotlight_solr_document_sidecars, :document_type, :string
@@ -1,4 +1,4 @@
1
- class AddSpotlightFeaturedImages < ActiveRecord::Migration
1
+ class AddSpotlightFeaturedImages < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_featured_images do |t|
4
4
  t.string :type
@@ -1,4 +1,4 @@
1
- class AddFeaturedImageToSpotlightClasses < ActiveRecord::Migration
1
+ class AddFeaturedImageToSpotlightClasses < ActiveRecord::Migration[4.2]
2
2
 
3
3
  def change
4
4
  add_column :spotlight_searches, :masthead_id, :integer
@@ -1,4 +1,4 @@
1
- class AddDisplayToSpotlightMainNavigations < ActiveRecord::Migration
1
+ class AddDisplayToSpotlightMainNavigations < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_column :spotlight_main_navigations, :display, :boolean, default: true
4
4
 
@@ -1,4 +1,4 @@
1
- class AddFieldTypeToCustomFields < ActiveRecord::Migration
1
+ class AddFieldTypeToCustomFields < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_column :spotlight_custom_fields, :field_type, :string
4
4
 
@@ -1,5 +1,5 @@
1
1
  # This migration comes from acts_as_taggable_on_engine (originally 3)
2
- class AddTaggingsCounterCacheToTags < ActiveRecord::Migration
2
+ class AddTaggingsCounterCacheToTags < ActiveRecord::Migration[4.2]
3
3
  def self.up
4
4
  add_column :tags, :taggings_count, :integer, default: 0
5
5
 
@@ -1,5 +1,5 @@
1
1
  # This migration comes from acts_as_taggable_on_engine (originally 4)
2
- class AddMissingTaggableIndex < ActiveRecord::Migration
2
+ class AddMissingTaggableIndex < ActiveRecord::Migration[4.2]
3
3
  def self.up
4
4
  add_index :taggings, [:taggable_id, :taggable_type, :context]
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # This migration comes from acts_as_taggable_on_engine (originally 5)
2
2
  # This migration is added to circumvent issue #623 and have special characters
3
3
  # work properly
4
- class ChangeCollationForTagNames < ActiveRecord::Migration
4
+ class ChangeCollationForTagNames < ActiveRecord::Migration[4.2]
5
5
  def up
6
6
  if ActsAsTaggableOn::Utils.using_mysql?
7
7
  execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;")
@@ -1,4 +1,4 @@
1
- class ChangeSpotlightSearchesToPublished < ActiveRecord::Migration
1
+ class ChangeSpotlightSearchesToPublished < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  rename_column :spotlight_searches, :on_landing_page, :published
4
4
  end
@@ -1,4 +1,4 @@
1
- class RemoveSearchableFromExhibit < ActiveRecord::Migration
1
+ class RemoveSearchableFromExhibit < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  Spotlight::Exhibit.where(searchable: false).find_each do |e|
4
4
  e.home_page.update(display_sidebar: false)
@@ -1,4 +1,4 @@
1
- class AddMetadataToSpotlightResource < ActiveRecord::Migration
1
+ class AddMetadataToSpotlightResource < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_column :spotlight_resources, :metadata, :binary
4
4
  end
@@ -1,4 +1,4 @@
1
- class ChangeSpotlightExhibitPublishedDefault < ActiveRecord::Migration
1
+ class ChangeSpotlightExhibitPublishedDefault < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  change_column :spotlight_exhibits, :published, :boolean, default: false
4
4
  end
@@ -1,4 +1,4 @@
1
- class RemoveDefaultFromSpotlightExhibit < ActiveRecord::Migration
1
+ class RemoveDefaultFromSpotlightExhibit < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  return unless Spotlight::Exhibit.column_names.include? 'default'
4
4
 
@@ -1,4 +1,4 @@
1
- class UpdateCustomFieldNames < ActiveRecord::Migration
1
+ class UpdateCustomFieldNames < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  fields = {}
4
4
 
@@ -1,4 +1,4 @@
1
- class AddWeightToExhibits < ActiveRecord::Migration
1
+ class AddWeightToExhibits < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_column :spotlight_exhibits, :weight, :integer, default: 50
4
4
  end
@@ -1,4 +1,4 @@
1
- class CreateSpotlightSite < ActiveRecord::Migration
1
+ class CreateSpotlightSite < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_sites do |t|
4
4
  t.string :title
@@ -1,4 +1,4 @@
1
- class AddSiteToSpotlightExhibits < ActiveRecord::Migration
1
+ class AddSiteToSpotlightExhibits < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_column :spotlight_exhibits, :site_id, :integer
4
4
  add_index :spotlight_exhibits, :site_id
@@ -1,4 +1,4 @@
1
- class ChangeRolesToSupportPolymorphicAssociations < ActiveRecord::Migration
1
+ class ChangeRolesToSupportPolymorphicAssociations < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_column :spotlight_roles, :resource_id, :integer
4
4
  add_column :spotlight_roles, :resource_type, :string
@@ -1,4 +1,4 @@
1
- class AddIndexStatusToResources < ActiveRecord::Migration
1
+ class AddIndexStatusToResources < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spotlight_resources, :index_status, :integer
4
4
  add_index :spotlight_resources, :index_status
@@ -1,4 +1,4 @@
1
- class CreateSpotlightExhibitFilters < ActiveRecord::Migration
1
+ class CreateSpotlightExhibitFilters < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_filters do |t|
4
4
  t.string :field
@@ -1,4 +1,4 @@
1
- class AddReadonlyToCustomFields < ActiveRecord::Migration
1
+ class AddReadonlyToCustomFields < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spotlight_custom_fields, :readonly_field, :boolean, default: false
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddDefaultViewToSpotlightSearches < ActiveRecord::Migration
1
+ class AddDefaultViewToSpotlightSearches < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spotlight_searches, :default_index_view_type, :string
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddIiifUrlsToFeaturedImage < ActiveRecord::Migration
1
+ class AddIiifUrlsToFeaturedImage < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spotlight_featured_images, :iiif_region, :string
4
4
  add_column :spotlight_featured_images, :iiif_manifest_url, :string
@@ -1,4 +1,4 @@
1
- class AddIiifUrlToContact < ActiveRecord::Migration
1
+ class AddIiifUrlToContact < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spotlight_contacts, :avatar_id, :integer
4
4
  add_index :spotlight_contacts, :avatar_id
@@ -1,4 +1,4 @@
1
- class AddUploadIdToResources < ActiveRecord::Migration
1
+ class AddUploadIdToResources < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spotlight_resources, :upload_id, :integer
4
4
  add_index :spotlight_resources, :upload_id
@@ -1,4 +1,4 @@
1
- class AddResourceToSolrDocumentSidecar < ActiveRecord::Migration
1
+ class AddResourceToSolrDocumentSidecar < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spotlight_solr_document_sidecars, :resource_id, :integer
4
4
  add_column :spotlight_solr_document_sidecars, :resource_type, :string
@@ -1,4 +1,4 @@
1
- class AddIndexStatusToSolrDocumentSidecar < ActiveRecord::Migration
1
+ class AddIndexStatusToSolrDocumentSidecar < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spotlight_solr_document_sidecars, :index_status, :binary
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddDocumentIndexToSolrDocumentSidecar < ActiveRecord::Migration
1
+ class AddDocumentIndexToSolrDocumentSidecar < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_index :spotlight_solr_document_sidecars, [:exhibit_id, :document_type, :document_id], name: 'spotlight_solr_document_sidecars_exhibit_document'
4
4
  add_index :spotlight_solr_document_sidecars, [:document_type, :document_id], name: 'spotlight_solr_document_sidecars_solr_document'
@@ -1,4 +1,4 @@
1
- class CreateSpotlightReindexingLogEntries < ActiveRecord::Migration
1
+ class CreateSpotlightReindexingLogEntries < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spotlight_reindexing_log_entries do |t|
4
4
  t.integer :items_reindexed_count
@@ -1,4 +1,4 @@
1
- class AddThemeToSpotlightExhibits < ActiveRecord::Migration
1
+ class AddThemeToSpotlightExhibits < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spotlight_exhibits, :theme, :string
4
4
  end
@@ -0,0 +1,17 @@
1
+ class MigrateTagsToSidecars < ActiveRecord::Migration[5.0]
2
+ def up
3
+ Spotlight::SolrDocumentSidecar.reset_column_information
4
+ ActsAsTaggableOn::Tagging.reset_column_information
5
+
6
+ ActsAsTaggableOn::Tagging.where(taggable_type: 'SolrDocument', tagger_type: 'Spotlight::Exhibit').find_each do |e|
7
+ sidecar = Spotlight::SolrDocumentSidecar.find_or_create_by(document_id: e.taggable_id, document_type: 'SolrDocument', exhibit_id: e.tagger_id)
8
+ e.update(taggable: sidecar)
9
+ end
10
+ end
11
+
12
+ def down
13
+ ActsAsTaggableOn::Tagging.where(taggable_type: 'Spotlight::SolrDocumentSidecar').find_each do |e|
14
+ e.update(taggable: e.taggable.document)
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module Spotlight
2
- VERSION = '0.34.1'.freeze
2
+ VERSION = '1.0.0.alpha1'.freeze
3
3
  end
@@ -60,17 +60,10 @@ describe Spotlight::AppearancesController, type: :controller do
60
60
  }
61
61
  end
62
62
  let(:main_navigation_attributes) do
63
- if Rails::VERSION::MAJOR >= 5
64
- {
65
- 0 => { id: first_nav.id, label: 'Some Label', weight: 500 },
66
- 1 => { id: last_nav.id, display: false }
67
- }
68
- else
69
- [
70
- { id: first_nav.id, label: 'Some Label', weight: 500 },
71
- { id: last_nav.id, display: false }
72
- ]
73
- end
63
+ {
64
+ 0 => { id: first_nav.id, label: 'Some Label', weight: 500 },
65
+ 1 => { id: last_nav.id, display: false }
66
+ }
74
67
  end
75
68
  it 'updates the navigation' do
76
69
  patch :update, params: submitted