enju_event 0.3.5 → 0.4.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/Rakefile +1 -1
- data/app/controllers/event_import_files_controller.rb +0 -1
- data/app/controllers/event_import_results_controller.rb +4 -4
- data/app/controllers/events_controller.rb +1 -1
- data/app/controllers/places_controller.rb +1 -1
- data/app/models/event.rb +37 -49
- data/app/models/event_category.rb +9 -7
- data/app/models/event_export_file.rb +9 -12
- data/app/models/event_import_file.rb +9 -5
- data/app/models/event_import_result.rb +1 -6
- data/app/views/event_categories/_form.html.erb +1 -1
- data/app/views/event_categories/index.html.erb +1 -1
- data/app/views/event_categories/show.html.erb +1 -1
- data/app/views/event_import_files/new.html.erb +2 -2
- data/app/views/event_import_files/show.html.erb +74 -70
- data/app/views/event_import_results/index.html.erb +12 -1
- data/app/views/event_import_results/index.txt.erb +3 -0
- data/app/views/events/_form.html.erb +2 -2
- data/app/views/events/index.atom.builder +2 -2
- data/app/views/events/index.html+phone.erb +2 -2
- data/app/views/events/index.html.erb +5 -5
- data/app/views/events/index.ics.erb +1 -1
- data/app/views/events/index.json.jbuilder +1 -1
- data/app/views/events/index.rss.builder +2 -2
- data/app/views/events/index.txt.erb +4 -0
- data/app/views/events/show.html+phone.erb +3 -3
- data/app/views/events/show.html.erb +3 -3
- data/app/views/layouts/calendar.html.erb +4 -4
- data/app/views/participates/index.html.erb +1 -1
- data/app/views/participates/show.html.erb +1 -1
- data/app/views/picture_files/_index_event.html.erb +1 -1
- data/config/locales/translation_en.yml +0 -1
- data/config/locales/translation_ja.yml +0 -1
- data/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
- data/lib/enju_event/engine.rb +1 -0
- data/lib/enju_event/version.rb +1 -1
- data/lib/generators/enju_event/setup/setup_generator.rb +3 -3
- data/lib/generators/enju_event/setup/templates/db/fixtures/event_categories.yml +35 -6
- data/spec/controllers/event_import_results_controller_spec.rb +2 -2
- data/spec/controllers/events_controller_spec.rb +2 -2
- data/spec/dummy/bin/bundle +1 -1
- data/spec/dummy/bin/setup +1 -3
- data/spec/dummy/bin/update +4 -2
- data/spec/dummy/bin/yarn +3 -3
- data/spec/dummy/config/database.yml +70 -9
- data/spec/dummy/config/initializers/assets.rb +1 -1
- data/spec/dummy/config/initializers/mime_types.rb +0 -1
- data/spec/dummy/db/migrate/154_create_messages.rb +4 -8
- data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +3 -3
- data/spec/dummy/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
- data/spec/dummy/db/migrate/{20181026064038_add_login_banner_to_library_group.rb → 20190630115523_add_login_banner_translations_to_library_group.rb} +1 -1
- data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
- data/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
- data/spec/dummy/db/migrate/20190713114940_add_profile_id_to_user.rb +5 -0
- data/spec/dummy/db/migrate/20190713115451_add_full_name_translations_to_profile.rb +5 -0
- data/spec/dummy/db/schema.rb +148 -266
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/factories/event_category.rb +4 -2
- data/spec/factories/library.rb +2 -0
- data/spec/fixtures/agent_types.yml +11 -11
- data/spec/fixtures/event_categories.yml +14 -13
- data/spec/fixtures/event_export_files.yml +1 -1
- data/spec/fixtures/events.yml +22 -29
- data/spec/fixtures/libraries.yml +30 -32
- data/spec/fixtures/library_groups.yml +44 -20
- data/spec/fixtures/shelves.yml +16 -15
- data/spec/models/event_category_spec.rb +8 -7
- data/spec/models/event_export_file_spec.rb +1 -1
- data/spec/models/event_spec.rb +14 -13
- data/spec/rails_helper.rb +5 -1
- data/spec/system/events_spec.rb +0 -5
- metadata +256 -389
- data/app/views/event_import_files/_results.html.erb +0 -26
- data/app/views/event_import_results/index.text.ruby +0 -5
- data/app/views/events/index.text.ruby +0 -7
- data/app/views/layouts/mailer.html.erb +0 -13
- data/app/views/layouts/mailer.text.erb +0 -1
- data/config/brakeman.ignore +0 -66
- data/spec/dummy/app/assets/config/manifest.js +0 -5
- data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +0 -13
- data/spec/dummy/db/migrate/20090831220301_create_lending_policies.rb +0 -21
- data/spec/dummy/db/migrate/20091202124834_create_versions.rb +0 -18
- data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +0 -13
- data/spec/dummy/db/migrate/20121116033446_add_doi_to_manifestation.rb +0 -6
- data/spec/dummy/db/migrate/20150421023923_create_identities.rb +0 -14
- data/spec/dummy/db/migrate/20151126005552_add_provider_to_identity.rb +0 -5
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +0 -18
- data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +0 -22
- data/spec/dummy/db/migrate/20160506144040_create_isbn_records.rb +0 -11
- data/spec/dummy/db/migrate/20181030072731_add_not_null_to_position_on_carrier_type.rb +0 -14
- data/spec/dummy/db/migrate/20181030074920_add_not_null_to_position_on_library.rb +0 -14
- data/spec/dummy/db/migrate/20190208135957_create_active_storage_tables.active_storage.rb +0 -27
- data/spec/dummy/db/migrate/20190311154610_create_periodicals.rb +0 -10
- data/spec/dummy/db/migrate/20190314151124_add_full_name_translations_to_create.rb +0 -7
- data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
- data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
- data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +0 -12
- data/spec/dummy/db/migrate/20200425072340_create_manifestation_custom_properties.rb +0 -12
- data/spec/dummy/db/migrate/20200425072349_create_item_custom_properties.rb +0 -12
- data/spec/dummy/db/migrate/20200425074758_create_manifestation_custom_values.rb +0 -12
- data/spec/dummy/db/migrate/20200425074822_create_item_custom_values.rb +0 -12
- data/spec/mailers/event_export_spec.rb +0 -5
- data/spec/mailers/event_import_spec.rb +0 -5
- data/spec/mailers/previews/event_export_preview.rb +0 -4
- data/spec/mailers/previews/event_import_preview.rb +0 -4
- data/spec/system/event_import_results_spec.rb +0 -17
- data/spec/views/event_import_results/index.text.ruby_spec.rb +0 -22
@@ -1,26 +0,0 @@
|
|
1
|
-
<h2><%= t('activerecord.models.event_import_result') %></h2>
|
2
|
-
<p>
|
3
|
-
<%= link_to((image_tag 'icons/page_white_excel.png', size: '16x16', class: 'enju_icon', alt: 'TSV'), event_import_results_path(event_import_file_id: @event_import_file.id, format: :txt, locale: @locale.to_s)) -%>
|
4
|
-
(<%= link_to 'TSV', event_import_results_path(event_import_file_id: @event_import_file.id, format: :txt, locale: @locale.to_s) -%>)
|
5
|
-
</p>
|
6
|
-
|
7
|
-
<table class="table table-striped index">
|
8
|
-
<tr>
|
9
|
-
<th><%= t('activerecord.attributes.event_import_result.lineno') %></th>
|
10
|
-
<th><%= t('activerecord.attributes.event_import_result.body') %></th>
|
11
|
-
<th><%= t('activerecord.models.event') %></th>
|
12
|
-
<th></th>
|
13
|
-
</tr>
|
14
|
-
<% @event_import_results.each_with_index do |event_import_result, idx| %>
|
15
|
-
<tr class="line<%= cycle("0", "1") -%>">
|
16
|
-
<td><%= @event_import_results.offset_value + idx + 1 %></td>
|
17
|
-
<td><%= event_import_result.body.inspect %></td>
|
18
|
-
<td><%= link_to event_import_result.event.display_name, event_import_result.event if event_import_result.event %></td>
|
19
|
-
<td>
|
20
|
-
<%= link_to t('page.show'), event_import_result %>
|
21
|
-
<%= link_to t('page.destroy'), event_import_result, data: {confirm: t('page.are_you_sure')}, method: :delete %>
|
22
|
-
</td>
|
23
|
-
</tr>
|
24
|
-
<% end %>
|
25
|
-
</table>
|
26
|
-
<%= paginate(@event_import_results) %>
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= yield %>
|
data/config/brakeman.ignore
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"ignored_warnings": [
|
3
|
-
{
|
4
|
-
"warning_type": "File Access",
|
5
|
-
"warning_code": 16,
|
6
|
-
"fingerprint": "0cc99b4df61bb345104e86e3061a1d3e8f23a8385c02a3f65a31701d5dd6e6a6",
|
7
|
-
"check_name": "SendFile",
|
8
|
-
"message": "Model attribute used in file name",
|
9
|
-
"file": "app/controllers/event_import_files_controller.rb",
|
10
|
-
"line": 34,
|
11
|
-
"link": "https://brakemanscanner.org/docs/warning_types/file_access/",
|
12
|
-
"code": "send_file(EventImportFile.find(params[:id]).event_import.path, :filename => EventImportFile.find(params[:id]).event_import_file_name, :type => \"application/octet-stream\")",
|
13
|
-
"render_path": null,
|
14
|
-
"location": {
|
15
|
-
"type": "method",
|
16
|
-
"class": "EventImportFilesController",
|
17
|
-
"method": "show"
|
18
|
-
},
|
19
|
-
"user_input": "EventImportFile.find(params[:id]).event_import.path",
|
20
|
-
"confidence": "Medium",
|
21
|
-
"note": ""
|
22
|
-
},
|
23
|
-
{
|
24
|
-
"warning_type": "File Access",
|
25
|
-
"warning_code": 16,
|
26
|
-
"fingerprint": "43e943cb9bc901967fc76b8120d84c754d5872e0a955b507ef00d8f613342c86",
|
27
|
-
"check_name": "SendFile",
|
28
|
-
"message": "Model attribute used in file name",
|
29
|
-
"file": "app/controllers/event_export_files_controller.rb",
|
30
|
-
"line": 33,
|
31
|
-
"link": "https://brakemanscanner.org/docs/warning_types/file_access/",
|
32
|
-
"code": "send_file(EventExportFile.find(params[:id]).event_export.path, :filename => EventExportFile.find(params[:id]).event_export_file_name, :type => \"application/octet-stream\")",
|
33
|
-
"render_path": null,
|
34
|
-
"location": {
|
35
|
-
"type": "method",
|
36
|
-
"class": "EventExportFilesController",
|
37
|
-
"method": "show"
|
38
|
-
},
|
39
|
-
"user_input": "EventExportFile.find(params[:id]).event_export.path",
|
40
|
-
"confidence": "Medium",
|
41
|
-
"note": ""
|
42
|
-
},
|
43
|
-
{
|
44
|
-
"warning_type": "Redirect",
|
45
|
-
"warning_code": 18,
|
46
|
-
"fingerprint": "e304fcb4b88a6522a29c32c654cee5d0a59c5fcce2e0a9a8862768c237a8e72a",
|
47
|
-
"check_name": "Redirect",
|
48
|
-
"message": "Possible unprotected redirect",
|
49
|
-
"file": "app/controllers/event_import_files_controller.rb",
|
50
|
-
"line": 32,
|
51
|
-
"link": "https://brakemanscanner.org/docs/warning_types/redirect/",
|
52
|
-
"code": "redirect_to(EventImportFile.find(params[:id]).event_import.expiring_url(10))",
|
53
|
-
"render_path": null,
|
54
|
-
"location": {
|
55
|
-
"type": "method",
|
56
|
-
"class": "EventImportFilesController",
|
57
|
-
"method": "show"
|
58
|
-
},
|
59
|
-
"user_input": "EventImportFile.find(params[:id]).event_import.expiring_url(10)",
|
60
|
-
"confidence": "High",
|
61
|
-
"note": ""
|
62
|
-
}
|
63
|
-
],
|
64
|
-
"updated": "2020-04-29 03:31:48 +0900",
|
65
|
-
"brakeman_version": "4.8.1"
|
66
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
class CreateExemplifies < ActiveRecord::Migration[4.2]
|
2
|
-
def change
|
3
|
-
create_table :exemplifies do |t|
|
4
|
-
t.integer :manifestation_id, null: false
|
5
|
-
t.integer :item_id, null: false
|
6
|
-
t.integer :position
|
7
|
-
|
8
|
-
t.timestamps
|
9
|
-
end
|
10
|
-
add_index :exemplifies, :manifestation_id
|
11
|
-
add_index :exemplifies, :item_id, unique: true
|
12
|
-
end
|
13
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
class CreateLendingPolicies < ActiveRecord::Migration[4.2]
|
2
|
-
def self.up
|
3
|
-
create_table :lending_policies do |t|
|
4
|
-
t.integer :item_id, null: false
|
5
|
-
t.integer :user_group_id, null: false
|
6
|
-
t.integer :loan_period, default: 0, null: false
|
7
|
-
t.datetime :fixed_due_date
|
8
|
-
t.integer :renewal, default: 0, null: false
|
9
|
-
t.integer :fine, default: 0, null: false
|
10
|
-
t.text :note
|
11
|
-
t.integer :position
|
12
|
-
|
13
|
-
t.timestamps
|
14
|
-
end
|
15
|
-
add_index :lending_policies, [:item_id, :user_group_id], unique: true
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.down
|
19
|
-
drop_table :lending_policies
|
20
|
-
end
|
21
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
class CreateVersions < ActiveRecord::Migration[4.2]
|
2
|
-
def self.up
|
3
|
-
create_table :versions do |t|
|
4
|
-
t.string :item_type, null: false
|
5
|
-
t.integer :item_id, null: false
|
6
|
-
t.string :event, null: false
|
7
|
-
t.string :whodunnit
|
8
|
-
t.text :object
|
9
|
-
t.datetime :created_at
|
10
|
-
end
|
11
|
-
add_index :versions, [:item_type, :item_id]
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.down
|
15
|
-
remove_index :versions, [:item_type, :item_id]
|
16
|
-
drop_table :versions
|
17
|
-
end
|
18
|
-
end
|
data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
class AddNumberOfDayToNotifyOverdueToUserGroup < ActiveRecord::Migration[4.2]
|
2
|
-
def self.up
|
3
|
-
add_column :user_groups, :number_of_day_to_notify_overdue, :integer, default: 1, null: false
|
4
|
-
add_column :user_groups, :number_of_day_to_notify_due_date, :integer, default: 7, null: false
|
5
|
-
add_column :user_groups, :number_of_time_to_notify_overdue, :integer, default: 3, null: false
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.down
|
9
|
-
remove_column :user_groups, :number_of_time_to_notify_overdue
|
10
|
-
remove_column :user_groups, :number_of_day_to_notify_due_date
|
11
|
-
remove_column :user_groups, :number_of_day_to_notify_overdue
|
12
|
-
end
|
13
|
-
end
|
@@ -1,14 +0,0 @@
|
|
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,18 +0,0 @@
|
|
1
|
-
# This migration comes from enju_library_engine (originally 20151213070943)
|
2
|
-
class AddTranslationTableToLibraryGroup < ActiveRecord::Migration[4.2]
|
3
|
-
def up
|
4
|
-
if defined?(Globalize)
|
5
|
-
LibraryGroup.create_translation_table!({
|
6
|
-
login_banner: :text
|
7
|
-
}, {
|
8
|
-
migrate_data: true
|
9
|
-
})
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def down
|
14
|
-
if defined?(Globalize)
|
15
|
-
LibraryGroup.drop_translation_table! migrate_data: true
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# This migration comes from enju_library_engine (originally 20151213072705)
|
2
|
-
class AddFooterBannerToLibraryGroup < ActiveRecord::Migration[4.2]
|
3
|
-
def up
|
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
|
11
|
-
end
|
12
|
-
|
13
|
-
def down
|
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
|
21
|
-
end
|
22
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class AddNotNullToPositionOnCarrierType < ActiveRecord::Migration[5.2]
|
2
|
-
def change
|
3
|
-
change_column :carrier_types, :position, :integer, null: false, default: 1
|
4
|
-
change_column :content_types, :position, :integer, null: false, default: 1
|
5
|
-
change_column :frequencies, :position, :integer, null: false, default: 1
|
6
|
-
change_column :licenses, :position, :integer, null: false, default: 1
|
7
|
-
change_column :creates, :position, :integer, null: false, default: 1
|
8
|
-
change_column :realizes, :position, :integer, null: false, default: 1
|
9
|
-
change_column :produces, :position, :integer, null: false, default: 1
|
10
|
-
change_column :owns, :position, :integer, null: false, default: 1
|
11
|
-
change_column :form_of_works, :position, :integer, null: false, default: 1
|
12
|
-
change_column :agent_types, :position, :integer, null: false, default: 1
|
13
|
-
end
|
14
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class AddNotNullToPositionOnLibrary < ActiveRecord::Migration[5.2]
|
2
|
-
def change
|
3
|
-
change_column :libraries, :position, :integer, null: false, default: 1
|
4
|
-
change_column :shelves, :position, :integer, null: false, default: 1
|
5
|
-
change_column :library_groups, :position, :integer, null: false, default: 1
|
6
|
-
change_column :user_groups, :position, :integer, null: false, default: 1
|
7
|
-
change_column :bookstores, :position, :integer, null: false, default: 1
|
8
|
-
change_column :budget_types, :position, :integer, null: false, default: 1
|
9
|
-
change_column :colors, :position, :integer, null: false, default: 1
|
10
|
-
change_column :request_types, :position, :integer, null: false, default: 1
|
11
|
-
change_column :request_status_types, :position, :integer, null: false, default: 1
|
12
|
-
change_column :search_engines, :position, :integer, null: false, default: 1
|
13
|
-
end
|
14
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# This migration comes from active_storage (originally 20170806125915)
|
2
|
-
class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
|
3
|
-
def change
|
4
|
-
create_table :active_storage_blobs do |t|
|
5
|
-
t.string :key, null: false
|
6
|
-
t.string :filename, null: false
|
7
|
-
t.string :content_type
|
8
|
-
t.text :metadata
|
9
|
-
t.bigint :byte_size, null: false
|
10
|
-
t.string :checksum, null: false
|
11
|
-
t.datetime :created_at, null: false
|
12
|
-
|
13
|
-
t.index [ :key ], unique: true
|
14
|
-
end
|
15
|
-
|
16
|
-
create_table :active_storage_attachments do |t|
|
17
|
-
t.string :name, null: false
|
18
|
-
t.references :record, null: false, polymorphic: true, index: false
|
19
|
-
t.references :blob, null: false
|
20
|
-
|
21
|
-
t.datetime :created_at, null: false
|
22
|
-
|
23
|
-
t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true
|
24
|
-
t.foreign_key :active_storage_blobs, column: :blob_id
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,7 +0,0 @@
|
|
1
|
-
class AddFullNameTranslationsToCreate < ActiveRecord::Migration[5.2]
|
2
|
-
def change
|
3
|
-
add_column :creates, :full_name_translations, :jsonb, default: {}
|
4
|
-
add_column :realizes, :full_name_translations, :jsonb, default: {}
|
5
|
-
add_column :produces, :full_name_translations, :jsonb, default: {}
|
6
|
-
end
|
7
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class CreateCustomProperties < ActiveRecord::Migration[5.2]
|
2
|
-
def change
|
3
|
-
create_table :custom_properties do |t|
|
4
|
-
t.integer :resource_id, null: false
|
5
|
-
t.string :resource_type, null: false
|
6
|
-
t.text :label, null: false
|
7
|
-
t.text :value
|
8
|
-
|
9
|
-
t.timestamps
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class CreateManifestationCustomProperties < ActiveRecord::Migration[5.2]
|
2
|
-
def change
|
3
|
-
create_table :manifestation_custom_properties do |t|
|
4
|
-
t.string :name, null: false, comment: 'ラベル名', index: {unique: true}
|
5
|
-
t.text :display_name, null: false, comment: '表示名'
|
6
|
-
t.text :note, comment: '備考'
|
7
|
-
t.integer :position, default: 1, null: false
|
8
|
-
|
9
|
-
t.timestamps
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class CreateItemCustomProperties < ActiveRecord::Migration[5.2]
|
2
|
-
def change
|
3
|
-
create_table :item_custom_properties do |t|
|
4
|
-
t.string :name, null: false, comment: 'ラベル名', index: {unique: true}
|
5
|
-
t.text :display_name, null: false, comment: '表示名'
|
6
|
-
t.text :note, comment: '備考'
|
7
|
-
t.integer :position, default: 1, null: false
|
8
|
-
|
9
|
-
t.timestamps
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class CreateManifestationCustomValues < ActiveRecord::Migration[5.2]
|
2
|
-
def change
|
3
|
-
create_table :manifestation_custom_values do |t|
|
4
|
-
t.references :manifestation_custom_property, null: false, foreign_key: true, index: {name: 'index_manifestation_custom_values_on_custom_property_id'}
|
5
|
-
t.references :manifestation, null: false, foreign_key: true
|
6
|
-
t.text :value
|
7
|
-
|
8
|
-
t.timestamps
|
9
|
-
end
|
10
|
-
add_index :manifestation_custom_values, [:manifestation_custom_property_id, :manifestation_id], unique: true, name: 'index_manifestation_custom_values_on_property_manifestation'
|
11
|
-
end
|
12
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class CreateItemCustomValues < ActiveRecord::Migration[5.2]
|
2
|
-
def change
|
3
|
-
create_table :item_custom_values do |t|
|
4
|
-
t.references :item_custom_property, null: false, foreign_key: true, index: {name: 'index_item_custom_values_on_custom_property_id'}
|
5
|
-
t.references :item, null: false, foreign_key: true
|
6
|
-
t.text :value
|
7
|
-
|
8
|
-
t.timestamps
|
9
|
-
end
|
10
|
-
add_index :item_custom_values, [:item_custom_property_id, :item_id], unique: true, name: 'index_item_custom_values_on_custom_item_property_and_item_id'
|
11
|
-
end
|
12
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
RSpec.describe 'EventImportResults', type: :system do
|
4
|
-
include Devise::Test::IntegrationHelpers
|
5
|
-
fixtures :all
|
6
|
-
|
7
|
-
describe 'When logged in as Administrator' do
|
8
|
-
before do
|
9
|
-
sign_in users(:admin)
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'should get event_import_results index' do
|
13
|
-
visit event_import_results_path
|
14
|
-
expect(page).not_to have_link 'TSV'
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
describe "event_import_results/index.text.ruby" do
|
4
|
-
fixtures :all
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
file = EventImportFile.create!(
|
8
|
-
event_import: File.new("#{Rails.root.to_s}/../../examples/event_import_file_sample1.tsv"),
|
9
|
-
default_library_id: 3,
|
10
|
-
default_event_category: EventCategory.find(3),
|
11
|
-
user: users(:admin)
|
12
|
-
)
|
13
|
-
file.import_start
|
14
|
-
assign(:event_import_file_id, file.id)
|
15
|
-
assign(:event_import_results, EventImportFile.find(file.id).event_import_results)
|
16
|
-
end
|
17
|
-
|
18
|
-
it "renders a list of event_import_results" do
|
19
|
-
render
|
20
|
-
expect(CSV.parse(rendered, headers: true, col_sep: "\t").first['library']).to eq 'hachioji'
|
21
|
-
end
|
22
|
-
end
|