enju_subject 0.3.0.beta.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +10 -0
  3. data/Rakefile +1 -1
  4. data/app/controllers/classification_types_controller.rb +1 -1
  5. data/app/controllers/classifications_controller.rb +1 -2
  6. data/app/controllers/subject_heading_types_controller.rb +1 -1
  7. data/app/controllers/subject_types_controller.rb +1 -1
  8. data/app/controllers/subjects_controller.rb +2 -3
  9. data/app/models/classification.rb +1 -1
  10. data/app/models/classification_type.rb +1 -1
  11. data/app/models/subject.rb +1 -1
  12. data/app/models/subject_heading_type.rb +1 -1
  13. data/app/models/subject_type.rb +1 -1
  14. data/app/views/classification_types/_form.html.erb +1 -1
  15. data/app/views/manifestations/_subject_facet.html.erb +1 -1
  16. data/app/views/subject_heading_types/_form.html.erb +1 -1
  17. data/app/views/subject_types/_form.html.erb +1 -1
  18. data/lib/enju_subject/version.rb +1 -1
  19. data/lib/generators/enju_subject/setup/setup_generator.rb +0 -1
  20. data/spec/controllers/classification_types_controller_spec.rb +2 -2
  21. data/spec/controllers/classifications_controller_spec.rb +1 -1
  22. data/spec/controllers/subject_heading_types_controller_spec.rb +2 -2
  23. data/spec/controllers/subject_types_controller_spec.rb +2 -2
  24. data/spec/controllers/subjects_controller_spec.rb +1 -1
  25. data/spec/dummy/app/models/application_record.rb +3 -0
  26. data/spec/dummy/config/application.rb +1 -1
  27. data/spec/dummy/config/database.yml +17 -22
  28. data/spec/dummy/db/migrate/059_create_libraries.rb +3 -5
  29. data/spec/dummy/db/migrate/069_create_shelves.rb +1 -2
  30. data/spec/dummy/db/migrate/080_create_library_groups.rb +1 -2
  31. data/spec/dummy/db/migrate/120_create_baskets.rb +1 -2
  32. data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +2 -5
  33. data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +1 -2
  34. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +0 -2
  35. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +2 -2
  36. data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +2 -4
  37. data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +3 -6
  38. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +1 -1
  39. data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +2 -2
  40. data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +4 -5
  41. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +1 -2
  42. data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +1 -1
  43. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +1 -1
  44. data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +1 -1
  45. data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +1 -1
  46. data/spec/dummy/db/migrate/20140821151023_create_colors.rb +1 -3
  47. data/spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
  48. data/spec/dummy/db/migrate/20150421023923_create_identities.rb +14 -0
  49. data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +3 -5
  50. data/spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb +6 -0
  51. data/spec/dummy/db/migrate/20151126005552_add_provider_to_identity.rb +5 -0
  52. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +11 -6
  53. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +15 -2
  54. data/spec/dummy/db/migrate/20160801080612_add_most_recent_to_import_request_transitions.rb +9 -0
  55. data/spec/dummy/db/migrate/20160801080619_add_most_recent_to_resource_import_file_transitions.rb +9 -0
  56. data/spec/dummy/db/migrate/20160801080637_add_most_recent_to_resource_export_file_transitions.rb +9 -0
  57. data/spec/dummy/db/migrate/20160801080643_add_most_recent_to_agent_import_file_transitions.rb +9 -0
  58. data/spec/dummy/db/migrate/20160811102604_add_picture_width_to_picture_file.rb +6 -0
  59. data/spec/dummy/db/migrate/20160820004638_add_attachment_attachment_to_carrier_types.rb +11 -0
  60. data/spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb +5 -0
  61. data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +5 -0
  62. data/spec/dummy/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb +5 -0
  63. data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +5 -0
  64. data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +5 -0
  65. data/spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +5 -0
  66. data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +13 -0
  67. data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +13 -0
  68. data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +13 -0
  69. data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +13 -0
  70. data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +13 -0
  71. data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +13 -0
  72. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +5 -0
  73. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +5 -0
  74. data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +12 -0
  75. data/spec/dummy/db/migrate/20200425072340_create_manifestation_custom_properties.rb +12 -0
  76. data/spec/dummy/db/migrate/20200425072349_create_item_custom_properties.rb +12 -0
  77. data/spec/dummy/db/migrate/20200425074758_create_manifestation_custom_values.rb +12 -0
  78. data/spec/dummy/db/migrate/20200425074822_create_item_custom_values.rb +12 -0
  79. data/spec/dummy/db/schema.rb +110 -13
  80. data/spec/factories/profile.rb +2 -2
  81. data/spec/factories/user.rb +13 -13
  82. data/spec/fixtures/library_groups.yml +37 -19
  83. data/spec/lib/generators/enju_subject/setup/setup_generator_spec.rb +1 -0
  84. metadata +120 -19
  85. data/README.rdoc +0 -10
@@ -8,7 +8,7 @@ class AddDcndlSchema < ActiveRecord::Migration[4.2]
8
8
  add_column :manifestations, :valid_until, :timestamp
9
9
  add_column :manifestations, :date_submitted, :timestamp
10
10
  add_column :manifestations, :date_accepted, :timestamp
11
- add_column :manifestations, :date_caputured, :timestamp
11
+ add_column :manifestations, :date_captured, :timestamp
12
12
  rename_column :manifestations, :copyright_date, :date_copyrighted
13
13
  end
14
14
 
@@ -21,7 +21,7 @@ class AddDcndlSchema < ActiveRecord::Migration[4.2]
21
21
  remove_column :manifestations, :valid_until
22
22
  remove_column :manifestations, :date_submitted
23
23
  remove_column :manifestations, :date_accepted
24
- remove_column :manifestations, :date_caputured
24
+ remove_column :manifestations, :date_captured
25
25
  rename_column :manifestations, :date_copyrighted, :copyright_date
26
26
  end
27
27
  end
@@ -1,12 +1,10 @@
1
1
  class CreateUserHasRoles < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :user_has_roles do |t|
4
- t.integer :user_id
5
- t.integer :role_id
4
+ t.references :user, index: true, foreign_key: true, null: false
5
+ t.references :role, index: true, foreign_key: true, null: false
6
6
 
7
7
  t.timestamps
8
8
  end
9
- add_index :user_has_roles, :user_id
10
- add_index :user_has_roles, :role_id
11
9
  end
12
10
  end
@@ -1,14 +1,11 @@
1
1
  class CreateAccepts < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :accepts do |t|
4
- t.integer :basket_id
5
- t.integer :item_id
6
- t.integer :librarian_id
4
+ t.references :basket, index: true
5
+ t.references :item, index: true
6
+ t.references :librarian, index: true
7
7
 
8
8
  t.timestamps
9
9
  end
10
-
11
- add_index :accepts, :basket_id
12
- add_index :accepts, :item_id
13
10
  end
14
11
  end
@@ -1,7 +1,7 @@
1
1
  class CreateUserImportFiles < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :user_import_files do |t|
4
- t.integer :user_id
4
+ t.references :user, index: true
5
5
  t.text :note
6
6
  t.datetime :executed_at
7
7
  t.string :user_import_file_name
@@ -1,8 +1,8 @@
1
1
  class CreateUserImportResults < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :user_import_results do |t|
4
- t.integer :user_import_file_id
5
- t.integer :user_id
4
+ t.references :user_import_file, index: true
5
+ t.references :user, index: true
6
6
  t.text :body
7
7
 
8
8
  t.timestamps
@@ -1,20 +1,19 @@
1
1
  class CreateProfiles < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :profiles do |t|
4
- t.integer :user_id
5
- t.integer :user_group_id
6
- t.integer :library_id
4
+ t.references :user, index: true, foreign_key: true
5
+ t.references :user_group, index: true
6
+ t.references :library, index: true
7
7
  t.string :locale
8
8
  t.string :user_number
9
9
  t.text :full_name
10
10
  t.text :note
11
11
  t.text :keyword_list
12
- t.integer :required_role_id
12
+ t.references :required_role, index: false
13
13
 
14
14
  t.timestamps
15
15
  end
16
16
 
17
- add_index :profiles, :user_id
18
17
  add_index :profiles, :user_number, unique: true
19
18
  end
20
19
  end
@@ -8,11 +8,10 @@ class CreateUserImportFileTransitions < ActiveRecord::Migration[4.2]
8
8
  t.text :metadata, default: "{}"
9
9
  end
10
10
  t.integer :sort_key
11
- t.integer :user_import_file_id
11
+ t.references :user_import_file, index: true
12
12
  t.timestamps
13
13
  end
14
14
 
15
- add_index :user_import_file_transitions, :user_import_file_id
16
15
  add_index :user_import_file_transitions, [:sort_key, :user_import_file_id], unique: true, name: "index_user_import_file_transitions_on_sort_key_and_file_id"
17
16
  end
18
17
  end
@@ -1,7 +1,7 @@
1
1
  class CreateUserExportFiles < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :user_export_files do |t|
4
- t.integer :user_id
4
+ t.references :user, index: true
5
5
  t.attachment :user_export
6
6
  t.datetime :executed_at
7
7
 
@@ -8,7 +8,7 @@ class CreateUserExportFileTransitions < ActiveRecord::Migration[4.2]
8
8
  t.text :metadata, default: "{}"
9
9
  end
10
10
  t.integer :sort_key
11
- t.integer :user_export_file_id
11
+ t.references :user_export_file, index: true
12
12
  t.timestamps
13
13
  end
14
14
 
@@ -1,5 +1,5 @@
1
1
  class AddDefaultLibraryIdToUserImportFile < ActiveRecord::Migration[4.2]
2
2
  def change
3
- add_column :user_import_files, :default_library_id, :integer
3
+ add_reference :user_import_files, :default_library
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  class AddDefaultUserGroupIdToUserImportFile < ActiveRecord::Migration[4.2]
2
2
  def change
3
- add_column :user_import_files, :default_user_group_id, :integer
3
+ add_reference :user_import_files, :default_user_group
4
4
  end
5
5
  end
@@ -1,14 +1,12 @@
1
1
  class CreateColors < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :colors do |t|
4
- t.integer :library_group_id
4
+ t.references :library_group, index: true
5
5
  t.string :property
6
6
  t.string :code
7
7
  t.integer :position
8
8
 
9
9
  t.timestamps
10
10
  end
11
-
12
- add_index :colors, :library_group_id
13
11
  end
14
12
  end
@@ -0,0 +1,5 @@
1
+ class AddForeignKeyToItemsReferencingManifestations < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_foreign_key :items, :manifestations
4
+ end
5
+ end
@@ -0,0 +1,14 @@
1
+ class CreateIdentities < ActiveRecord::Migration[4.2]
2
+ def change
3
+ create_table :identities do |t|
4
+ t.string :name
5
+ t.string :email
6
+ t.string :password_digest
7
+ t.references :profile, index: true
8
+
9
+ t.timestamps null: false
10
+ end
11
+ add_index :identities, :name
12
+ add_index :identities, :email
13
+ end
14
+ end
@@ -1,13 +1,11 @@
1
1
  class CreateWithdraws < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :withdraws do |t|
4
- t.integer :basket_id
5
- t.integer :item_id
6
- t.integer :librarian_id
4
+ t.references :basket, index: true
5
+ t.references :item, index: true
6
+ t.references :librarian, index: true
7
7
 
8
8
  t.timestamps null: false
9
9
  end
10
- add_index :withdraws, :basket_id
11
- add_index :withdraws, :item_id
12
10
  end
13
11
  end
@@ -0,0 +1,6 @@
1
+ class AddProfileIdToAgent < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :agents, :profile_id, :integer
4
+ add_index :agents, :profile_id
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddProviderToIdentity < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :identities, :provider, :string
4
+ end
5
+ end
@@ -1,13 +1,18 @@
1
+ # This migration comes from enju_library_engine (originally 20151213070943)
1
2
  class AddTranslationTableToLibraryGroup < ActiveRecord::Migration[4.2]
2
3
  def up
3
- LibraryGroup.create_translation_table!({
4
- login_banner: :text
5
- }, {
6
- migrate_data: true
7
- })
4
+ if defined?(Globalize)
5
+ LibraryGroup.create_translation_table!({
6
+ login_banner: :text
7
+ }, {
8
+ migrate_data: true
9
+ })
10
+ end
8
11
  end
9
12
 
10
13
  def down
11
- LibraryGroup.drop_translation_table! migrate_data: true
14
+ if defined?(Globalize)
15
+ LibraryGroup.drop_translation_table! migrate_data: true
16
+ end
12
17
  end
13
18
  end
@@ -1,9 +1,22 @@
1
+ # This migration comes from enju_library_engine (originally 20151213072705)
1
2
  class AddFooterBannerToLibraryGroup < ActiveRecord::Migration[4.2]
2
3
  def up
3
- LibraryGroup.add_translation_fields! footer_banner: :text
4
+ if defined?(Globalize)
5
+ LibraryGroup.add_translation_fields! footer_banner: :text
6
+ end
7
+
8
+ if defined?(AwesomeHstoreTranslate)
9
+ add_column :library_groups, :footer_banner, :hstore
10
+ end
4
11
  end
5
12
 
6
13
  def down
7
- remove_column :library_group_translations, :footer_banner
14
+ if defined?(Globalize)
15
+ remove_column :library_group_translations, :footer_banner
16
+ end
17
+
18
+ if defined?(AwesomeHstoreTranslate)
19
+ remove_column :library_groups, :footer_banner
20
+ end
8
21
  end
9
22
  end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToImportRequestTransitions < ActiveRecord::Migration[4.2]
2
+ def up
3
+ add_column :import_request_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :import_request_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToResourceImportFileTransitions < ActiveRecord::Migration[4.2]
2
+ def up
3
+ add_column :resource_import_file_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :resource_import_file_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToResourceExportFileTransitions < ActiveRecord::Migration[4.2]
2
+ def up
3
+ add_column :resource_export_file_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :resource_export_file_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToAgentImportFileTransitions < ActiveRecord::Migration[4.2]
2
+ def up
3
+ add_column :agent_import_file_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :agent_import_file_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ class AddPictureWidthToPictureFile < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :picture_files, :picture_width, :integer
4
+ add_column :picture_files, :picture_height, :integer
5
+ end
6
+ end
@@ -0,0 +1,11 @@
1
+ class AddAttachmentAttachmentToCarrierTypes < ActiveRecord::Migration[4.2]
2
+ def self.up
3
+ change_table :carrier_types do |t|
4
+ t.attachment :attachment
5
+ end
6
+ end
7
+
8
+ def self.down
9
+ remove_attachment :carrier_types, :attachment
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class AddCsvCharsetConversionToLibraryGroup < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :library_groups, :csv_charset_conversion, :boolean, null: false, default: false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddHeaderLogoToLibraryGroup < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_attachment :library_groups, :header_logo
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class SetNotNullToManifestationIdOnItems < ActiveRecord::Migration[4.2]
2
+ def change
3
+ change_column_null :items, :manifestation_id, false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class RenameLoginBannerToOldLoginBanner < ActiveRecord::Migration[4.2]
2
+ def change
3
+ rename_column :library_groups, :login_banner, :old_login_banner
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddForeignKeyToLibraryGroupIdOnLibrary < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_foreign_key :libraries, :library_groups, null: false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddHeaderLogoMetaToLibraryGroup < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :library_groups, :header_logo_meta, :text
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForUserImportFileTransitions < ActiveRecord::Migration[4.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :user_import_file_transitions, [:user_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_user_import_file_transitions_parent_most_recent" #, algorithm: :concurrently
6
+ change_column_null :user_import_file_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :user_import_file_transitions, name: "index_user_import_file_transitions_parent_most_recent"
11
+ change_column_null :user_import_file_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForUserExportFileTransitions < ActiveRecord::Migration[4.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :user_export_file_transitions, [:user_export_file_id, :most_recent], unique: true, where: "most_recent", name: "index_user_export_file_transitions_parent_most_recent" #, algorithm: :concurrently
6
+ change_column_null :user_export_file_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :user_export_file_transitions, name: "index_user_export_file_transitions_parent_most_recent"
11
+ change_column_null :user_export_file_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForAgentImportFileTransitions < ActiveRecord::Migration[4.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :agent_import_file_transitions, [:agent_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_agent_import_file_transitions_parent_most_recent" #, algorithm: :concurrently
6
+ change_column_null :agent_import_file_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :agent_import_file_transitions, name: "index_agent_import_file_transitions_parent_most_recent"
11
+ change_column_null :agent_import_file_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForResourceImportFileTransitions < ActiveRecord::Migration[4.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :resource_import_file_transitions, [:resource_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_resource_import_file_transitions_parent_most_recent" #, algorithm: :concurrently
6
+ change_column_null :resource_import_file_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :resource_import_file_transitions, name: "index_resource_import_file_transitions_parent_most_recent"
11
+ change_column_null :resource_import_file_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForResourceExportFileTransitions < ActiveRecord::Migration[4.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :resource_export_file_transitions, [:resource_export_file_id, :most_recent], unique: true, where: "most_recent", name: "index_resource_export_file_transitions_parent_most_recent" #, algorithm: :concurrently
6
+ change_column_null :resource_export_file_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :resource_export_file_transitions, name: "index_resource_export_file_transitions_parent_most_recent"
11
+ change_column_null :resource_export_file_transitions, :most_recent, true
12
+ end
13
+ end