enju_message 0.3.4 → 0.4.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -3
  3. data/Rakefile +1 -1
  4. data/app/controllers/message_requests_controller.rb +2 -2
  5. data/app/models/message.rb +2 -2
  6. data/app/models/message_request.rb +3 -2
  7. data/app/models/message_request_transition.rb +2 -2
  8. data/app/models/message_template.rb +2 -2
  9. data/app/models/message_transition.rb +2 -2
  10. data/app/views/message_requests/edit.html.erb +3 -3
  11. data/app/views/message_requests/index.html.erb +2 -2
  12. data/app/views/message_requests/new.html.erb +1 -1
  13. data/app/views/message_requests/show.html.erb +2 -2
  14. data/db/migrate/149_create_message_templates.rb +8 -3
  15. data/db/migrate/154_create_messages.rb +8 -4
  16. data/db/migrate/20080819181903_create_message_requests.rb +7 -2
  17. data/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +7 -2
  18. data/db/migrate/20120125050502_add_depth_to_message.rb +2 -1
  19. data/db/migrate/20140518111006_create_message_transitions.rb +8 -3
  20. data/db/migrate/20140518135713_create_message_request_transitions.rb +8 -3
  21. data/db/migrate/20160703185015_add_most_recent_to_message_transitions.rb +1 -1
  22. data/db/migrate/20160814165332_add_most_recent_to_message_request_transitions.rb +1 -1
  23. data/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +1 -1
  24. data/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +1 -1
  25. data/lib/enju_message/version.rb +1 -1
  26. data/spec/controllers/messages_controller_spec.rb +1 -2
  27. data/spec/dummy/config/database.yml +70 -9
  28. data/spec/dummy/db/development.sqlite3 +0 -0
  29. data/spec/dummy/db/migrate/005_create_manifestations.rb +3 -3
  30. data/spec/dummy/db/migrate/113_create_events.rb +21 -0
  31. data/spec/dummy/db/migrate/114_create_event_categories.rb +16 -0
  32. data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +23 -0
  33. data/spec/dummy/db/migrate/20090519203307_create_participates.rb +15 -0
  34. data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +15 -0
  35. data/spec/dummy/db/migrate/20120413051535_add_event_import_fingerprint_to_event_import_file.rb +5 -0
  36. data/spec/dummy/db/migrate/20120413170734_add_error_message_to_event_import_file.rb +5 -0
  37. data/spec/dummy/db/migrate/20120415060342_rename_event_import_file_imported_at_to_executed_at.rb +9 -0
  38. data/spec/dummy/db/migrate/20140523171309_create_event_import_file_transitions.rb +18 -0
  39. data/spec/dummy/db/migrate/20140628071719_add_user_encoding_to_event_import_file.rb +5 -0
  40. data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +5 -0
  41. data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +11 -0
  42. data/spec/dummy/db/migrate/20140812153137_create_event_export_file_transitions.rb +18 -0
  43. data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +5 -0
  44. data/spec/dummy/db/migrate/20151128142913_create_places.rb +14 -0
  45. data/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb +5 -0
  46. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +8 -0
  47. data/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
  48. data/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
  49. data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +1 -1
  50. data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +1 -1
  51. data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +1 -1
  52. data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +1 -1
  53. data/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb +13 -0
  54. data/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb +13 -0
  55. data/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb +5 -0
  56. data/spec/dummy/db/migrate/20190102034126_create_doi_records.rb +13 -0
  57. data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
  58. data/spec/dummy/db/migrate/{20181026064038_add_login_banner_to_library_group.rb → 20190630115523_add_login_banner_translations_to_library_group.rb} +1 -1
  59. data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
  60. data/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
  61. data/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
  62. data/spec/dummy/db/schema.rb +265 -133
  63. data/spec/dummy/db/test.sqlite3 +0 -0
  64. data/spec/fixtures/agents.yml +29 -30
  65. data/spec/fixtures/libraries.yml +28 -30
  66. data/spec/fixtures/library_groups.yml +36 -19
  67. data/spec/fixtures/message_request_transitions.yml +2 -2
  68. data/spec/fixtures/message_requests.yml +3 -2
  69. data/spec/fixtures/message_templates.yml +2 -2
  70. data/spec/fixtures/messages.yml +3 -3
  71. data/spec/fixtures/roles.yml +22 -5
  72. data/spec/fixtures/shelves.yml +45 -0
  73. data/spec/fixtures/user_groups.yml +23 -5
  74. data/spec/fixtures/users.yml +1 -1
  75. data/spec/models/message_request_spec.rb +13 -3
  76. data/spec/models/message_spec.rb +2 -2
  77. data/spec/models/message_template_spec.rb +2 -2
  78. data/spec/rails_helper.rb +5 -1
  79. metadata +276 -302
  80. data/spec/dummy/app/jobs/application_job.rb +0 -7
  81. data/spec/dummy/db/migrate/20150421023923_create_identities.rb +0 -14
  82. data/spec/dummy/db/migrate/20151126005552_add_provider_to_identity.rb +0 -5
  83. data/spec/dummy/db/migrate/20170114174536_add_profile_id_to_user.rb +0 -5
  84. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
  85. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
  86. data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +0 -12
@@ -0,0 +1,18 @@
1
+ class CreateEventExportFileTransitions < ActiveRecord::Migration[4.2]
2
+ def change
3
+ create_table :event_export_file_transitions do |t|
4
+ t.string :to_state
5
+ if ActiveRecord::Base.configurations[Rails.env]["adapter"].try(:match, /mysql/)
6
+ t.text :metadata
7
+ else
8
+ t.text :metadata, default: "{}"
9
+ end
10
+ t.integer :sort_key
11
+ t.integer :event_export_file_id
12
+ t.timestamps
13
+ end
14
+
15
+ add_index :event_export_file_transitions, :event_export_file_id, name: "index_event_export_file_transitions_on_file_id"
16
+ add_index :event_export_file_transitions, [:sort_key, :event_export_file_id], unique: true, name: "index_event_export_file_transitions_on_sort_key_and_file_id"
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ class AddDefaultEventCategoryIdToEventImportFile < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_reference :event_import_files, :default_event_category
4
+ end
5
+ end
@@ -0,0 +1,14 @@
1
+ class CreatePlaces < ActiveRecord::Migration[4.2]
2
+ def change
3
+ create_table :places do |t|
4
+ t.string :term
5
+ t.text :city
6
+ t.references :country, index: true
7
+ t.float :latitude
8
+ t.float :longitude
9
+
10
+ t.timestamps null: false
11
+ end
12
+ add_index :places, :term
13
+ end
14
+ end
@@ -0,0 +1,5 @@
1
+ class AddPlaceIdToEvent < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_reference :events, :place, index: true
4
+ end
5
+ end
@@ -8,11 +8,19 @@ class AddTranslationTableToLibraryGroup < ActiveRecord::Migration[4.2]
8
8
  migrate_data: true
9
9
  })
10
10
  end
11
+
12
+ if defined?(AwesomeHstoreTranslate)
13
+ add_column :library_groups, :login_banner, :hstore
14
+ end
11
15
  end
12
16
 
13
17
  def down
14
18
  if defined?(Globalize)
15
19
  LibraryGroup.drop_translation_table! migrate_data: true
16
20
  end
21
+
22
+ if defined?(AwesomeHstoreTranslate)
23
+ remove_column :library_groups, :login_banner
24
+ end
17
25
  end
18
26
  end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToEventImportFileTransitions < ActiveRecord::Migration[4.2]
2
+ def up
3
+ add_column :event_import_file_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :event_import_file_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToEventExportFileTransitions < ActiveRecord::Migration[4.2]
2
+ def up
3
+ add_column :event_export_file_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :event_export_file_transitions, :most_recent
8
+ end
9
+ end
@@ -2,7 +2,7 @@ class AddConstraintsToMostRecentForAgentImportFileTransitions < ActiveRecord::Mi
2
2
  disable_ddl_transaction!
3
3
 
4
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
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
6
  change_column_null :agent_import_file_transitions, :most_recent, false
7
7
  end
8
8
 
@@ -2,7 +2,7 @@ class AddConstraintsToMostRecentForResourceImportFileTransitions < ActiveRecord:
2
2
  disable_ddl_transaction!
3
3
 
4
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
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
6
  change_column_null :resource_import_file_transitions, :most_recent, false
7
7
  end
8
8
 
@@ -2,7 +2,7 @@ class AddConstraintsToMostRecentForResourceExportFileTransitions < ActiveRecord:
2
2
  disable_ddl_transaction!
3
3
 
4
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
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
6
  change_column_null :resource_export_file_transitions, :most_recent, false
7
7
  end
8
8
 
@@ -2,7 +2,7 @@ class AddConstraintsToMostRecentForImportRequestTransitions < ActiveRecord::Migr
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
5
- add_index :import_request_transitions, [:import_request_id, :most_recent], unique: true, where: "most_recent", name: "index_import_request_transitions_parent_most_recent" #, algorithm: :concurrently
5
+ add_index :import_request_transitions, [:import_request_id, :most_recent], unique: true, where: "most_recent", name: "index_import_request_transitions_parent_most_recent" # , algorithm: :concurrently
6
6
  change_column_null :import_request_transitions, :most_recent, false
7
7
  end
8
8
 
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForEventImportFileTransitions < ActiveRecord::Migration[4.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :event_import_file_transitions, [:event_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_event_import_file_transitions_parent_most_recent" #, algorithm: :concurrently
6
+ change_column_null :event_import_file_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :event_import_file_transitions, name: "index_event_import_file_transitions_parent_most_recent"
11
+ change_column_null :event_import_file_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForEventExportFileTransitions < ActiveRecord::Migration[4.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :event_export_file_transitions, [:event_export_file_id, :most_recent], unique: true, where: "most_recent", name: "index_event_export_file_transitions_parent_most_recent" #, algorithm: :concurrently
6
+ change_column_null :event_export_file_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :event_export_file_transitions, name: "index_event_export_file_transitions_parent_most_recent"
11
+ change_column_null :event_export_file_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,5 @@
1
+ class AddForeignKeyToEventsReferencingEventCategories < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_foreign_key :events, :event_categories
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ class CreateDoiRecords < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :doi_records do |t|
4
+ t.string :body, index: {unique: true}, null: false
5
+ t.string :display_body, null: false
6
+ t.string :source
7
+ t.jsonb :response, default: {}, null: false
8
+ t.references :manifestation, foreign_key: true, null: false
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ class AddDisplayNameTranslationsToLibraryGroup < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :budget_types, :display_name_translations, :jsonb, default: {}, null: false
4
+ add_column :libraries, :display_name_translations, :jsonb, default: {}, null: false
5
+ add_column :library_groups, :display_name_translations, :jsonb, default: {}, null: false
6
+ add_column :request_status_types, :display_name_translations, :jsonb, default: {}, null: false
7
+ add_column :request_types, :display_name_translations, :jsonb, default: {}, null: false
8
+ add_column :search_engines, :display_name_translations, :jsonb, default: {}, null: false
9
+ add_column :shelves, :display_name_translations, :jsonb, default: {}, null: false
10
+ add_column :user_groups, :display_name_translations, :jsonb, default: {}, null: false
11
+ end
12
+ end
@@ -1,4 +1,4 @@
1
- class AddLoginBannerToLibraryGroup < ActiveRecord::Migration[5.2]
1
+ class AddLoginBannerTranslationsToLibraryGroup < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_column :library_groups, :login_banner_translations, :jsonb, default: {}, null: false
4
4
  add_column :library_groups, :footer_banner_translations, :jsonb, default: {}, null: false
@@ -0,0 +1,5 @@
1
+ class AddDisplayNameTranslationsToRole < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :roles, :display_name_translations, :jsonb, default: {}, null: false
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ class AddDisplayNameTranslationsToEvent < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :event_categories, :display_name_translations, :jsonb, default: {}, null: false
4
+ add_column :events, :display_name_translations, :jsonb, default: {}, null: false
5
+ end
6
+ end
@@ -0,0 +1,21 @@
1
+ class AddDisplayNameTranslationsToCarrierType < ActiveRecord::Migration[5.2]
2
+ def change
3
+ [
4
+ :agent_relationship_types,
5
+ :agent_types,
6
+ :carrier_types,
7
+ :content_types,
8
+ :create_types,
9
+ :form_of_works,
10
+ :frequencies,
11
+ :languages,
12
+ :licenses,
13
+ :manifestation_relationship_types,
14
+ :medium_of_performances,
15
+ :produce_types,
16
+ :realize_types
17
+ ].each do |table|
18
+ add_column table, :display_name_translations, :jsonb, default: {}, null: false
19
+ end
20
+ end
21
+ end