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.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/Rakefile +1 -1
  4. data/app/controllers/event_import_files_controller.rb +0 -1
  5. data/app/controllers/event_import_results_controller.rb +4 -4
  6. data/app/controllers/events_controller.rb +1 -1
  7. data/app/controllers/places_controller.rb +1 -1
  8. data/app/models/event.rb +37 -49
  9. data/app/models/event_category.rb +9 -7
  10. data/app/models/event_export_file.rb +9 -12
  11. data/app/models/event_import_file.rb +9 -5
  12. data/app/models/event_import_result.rb +1 -6
  13. data/app/views/event_categories/_form.html.erb +1 -1
  14. data/app/views/event_categories/index.html.erb +1 -1
  15. data/app/views/event_categories/show.html.erb +1 -1
  16. data/app/views/event_import_files/new.html.erb +2 -2
  17. data/app/views/event_import_files/show.html.erb +74 -70
  18. data/app/views/event_import_results/index.html.erb +12 -1
  19. data/app/views/event_import_results/index.txt.erb +3 -0
  20. data/app/views/events/_form.html.erb +2 -2
  21. data/app/views/events/index.atom.builder +2 -2
  22. data/app/views/events/index.html+phone.erb +2 -2
  23. data/app/views/events/index.html.erb +5 -5
  24. data/app/views/events/index.ics.erb +1 -1
  25. data/app/views/events/index.json.jbuilder +1 -1
  26. data/app/views/events/index.rss.builder +2 -2
  27. data/app/views/events/index.txt.erb +4 -0
  28. data/app/views/events/show.html+phone.erb +3 -3
  29. data/app/views/events/show.html.erb +3 -3
  30. data/app/views/layouts/calendar.html.erb +4 -4
  31. data/app/views/participates/index.html.erb +1 -1
  32. data/app/views/participates/show.html.erb +1 -1
  33. data/app/views/picture_files/_index_event.html.erb +1 -1
  34. data/config/locales/translation_en.yml +0 -1
  35. data/config/locales/translation_ja.yml +0 -1
  36. data/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
  37. data/lib/enju_event/engine.rb +1 -0
  38. data/lib/enju_event/version.rb +1 -1
  39. data/lib/generators/enju_event/setup/setup_generator.rb +3 -3
  40. data/lib/generators/enju_event/setup/templates/db/fixtures/event_categories.yml +35 -6
  41. data/spec/controllers/event_import_results_controller_spec.rb +2 -2
  42. data/spec/controllers/events_controller_spec.rb +2 -2
  43. data/spec/dummy/bin/bundle +1 -1
  44. data/spec/dummy/bin/setup +1 -3
  45. data/spec/dummy/bin/update +4 -2
  46. data/spec/dummy/bin/yarn +3 -3
  47. data/spec/dummy/config/database.yml +70 -9
  48. data/spec/dummy/config/initializers/assets.rb +1 -1
  49. data/spec/dummy/config/initializers/mime_types.rb +0 -1
  50. data/spec/dummy/db/migrate/154_create_messages.rb +4 -8
  51. data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +3 -3
  52. data/spec/dummy/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +1 -1
  53. data/spec/dummy/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +1 -1
  54. data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
  55. data/spec/dummy/db/migrate/{20181026064038_add_login_banner_to_library_group.rb → 20190630115523_add_login_banner_translations_to_library_group.rb} +1 -1
  56. data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
  57. data/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
  58. data/spec/dummy/db/migrate/20190713114940_add_profile_id_to_user.rb +5 -0
  59. data/spec/dummy/db/migrate/20190713115451_add_full_name_translations_to_profile.rb +5 -0
  60. data/spec/dummy/db/schema.rb +148 -266
  61. data/spec/dummy/db/test.sqlite3 +0 -0
  62. data/spec/factories/event_category.rb +4 -2
  63. data/spec/factories/library.rb +2 -0
  64. data/spec/fixtures/agent_types.yml +11 -11
  65. data/spec/fixtures/event_categories.yml +14 -13
  66. data/spec/fixtures/event_export_files.yml +1 -1
  67. data/spec/fixtures/events.yml +22 -29
  68. data/spec/fixtures/libraries.yml +30 -32
  69. data/spec/fixtures/library_groups.yml +44 -20
  70. data/spec/fixtures/shelves.yml +16 -15
  71. data/spec/models/event_category_spec.rb +8 -7
  72. data/spec/models/event_export_file_spec.rb +1 -1
  73. data/spec/models/event_spec.rb +14 -13
  74. data/spec/rails_helper.rb +5 -1
  75. data/spec/system/events_spec.rb +0 -5
  76. metadata +256 -389
  77. data/app/views/event_import_files/_results.html.erb +0 -26
  78. data/app/views/event_import_results/index.text.ruby +0 -5
  79. data/app/views/events/index.text.ruby +0 -7
  80. data/app/views/layouts/mailer.html.erb +0 -13
  81. data/app/views/layouts/mailer.text.erb +0 -1
  82. data/config/brakeman.ignore +0 -66
  83. data/spec/dummy/app/assets/config/manifest.js +0 -5
  84. data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +0 -13
  85. data/spec/dummy/db/migrate/20090831220301_create_lending_policies.rb +0 -21
  86. data/spec/dummy/db/migrate/20091202124834_create_versions.rb +0 -18
  87. data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +0 -13
  88. data/spec/dummy/db/migrate/20121116033446_add_doi_to_manifestation.rb +0 -6
  89. data/spec/dummy/db/migrate/20150421023923_create_identities.rb +0 -14
  90. data/spec/dummy/db/migrate/20151126005552_add_provider_to_identity.rb +0 -5
  91. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +0 -18
  92. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +0 -22
  93. data/spec/dummy/db/migrate/20160506144040_create_isbn_records.rb +0 -11
  94. data/spec/dummy/db/migrate/20181030072731_add_not_null_to_position_on_carrier_type.rb +0 -14
  95. data/spec/dummy/db/migrate/20181030074920_add_not_null_to_position_on_library.rb +0 -14
  96. data/spec/dummy/db/migrate/20190208135957_create_active_storage_tables.active_storage.rb +0 -27
  97. data/spec/dummy/db/migrate/20190311154610_create_periodicals.rb +0 -10
  98. data/spec/dummy/db/migrate/20190314151124_add_full_name_translations_to_create.rb +0 -7
  99. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
  100. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
  101. data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +0 -12
  102. data/spec/dummy/db/migrate/20200425072340_create_manifestation_custom_properties.rb +0 -12
  103. data/spec/dummy/db/migrate/20200425072349_create_item_custom_properties.rb +0 -12
  104. data/spec/dummy/db/migrate/20200425074758_create_manifestation_custom_values.rb +0 -12
  105. data/spec/dummy/db/migrate/20200425074822_create_item_custom_values.rb +0 -12
  106. data/spec/mailers/event_export_spec.rb +0 -5
  107. data/spec/mailers/event_import_spec.rb +0 -5
  108. data/spec/mailers/previews/event_export_preview.rb +0 -4
  109. data/spec/mailers/previews/event_import_preview.rb +0 -4
  110. data/spec/system/event_import_results_spec.rb +0 -17
  111. data/spec/views/event_import_results/index.text.ruby_spec.rb +0 -22
@@ -1,6 +1,6 @@
1
1
  json.array!(@events) do |event|
2
2
  json.extract! event, :id
3
- json.title event.display_name.localize
3
+ json.title event.display_name
4
4
  if event.all_day
5
5
  json.start event.start_at.iso8601
6
6
  json.end event.end_at.tomorrow.beginning_of_day.iso8601
@@ -3,7 +3,7 @@ xml.rss('version' => "2.0",
3
3
  'xmlns:opensearch' => "http://a9.com/-/spec/opensearch/1.1/",
4
4
  'xmlns:atom' => "http://www.w3.org/2005/Atom"){
5
5
  xml.channel{
6
- xml.title t('event.library_group_event', library_group_name: @library_group.display_name.localize)
6
+ xml.title t('event.library_group_event', library_group_name: @library_group.display_name)
7
7
  xml.link "#{request.protocol}#{request.host_with_port}#{url_for(params.permit.merge(format: nil, only_path: true))}"
8
8
  xml.description "Next-L Enju, an open source integrated library system developed by Project Next-L"
9
9
  xml.language @locale.to_s
@@ -19,7 +19,7 @@ xml.rss('version' => "2.0",
19
19
  end
20
20
  @events.each do |event|
21
21
  xml.item do
22
- xml.title event.display_name.localize
22
+ xml.title event.display_name
23
23
  xml.description event.note
24
24
  # rfc822
25
25
  xml.pubDate event.created_at.rfc2822
@@ -0,0 +1,4 @@
1
+ library name note start_at end_at
2
+ <%- @events.each do |event| -%>
3
+ "<%=h event.library.display_name.gsub(/"/, '""') -%>" "<%=h event.display_name.gsub(/"/, '""') -%>" "<%=h event.note.to_s.gsub(/"/, '""') -%>" "<%=h event.start_at.to_s.gsub(/"/, '""') -%>" "<%=h event.end_at.to_s.gsub(/"/, '""') %>
4
+ <%- end -%>
@@ -4,17 +4,17 @@
4
4
 
5
5
  <div data-role="content">
6
6
  <h2 class="resource_title">
7
- <%= @event.display_name.localize -%>
7
+ <%= @event.display_name -%>
8
8
  </h2>
9
9
 
10
10
  <p>
11
11
  <strong><%= t('activerecord.models.event_category') -%>:</strong>
12
- <%= @event.event_category.display_name.localize -%>
12
+ <%= @event.event_category.display_name -%>
13
13
  </p>
14
14
 
15
15
  <p>
16
16
  <strong><%= t('activerecord.models.library') -%>:</strong>
17
- <%= link_to @event.library.display_name.localize, @event.library -%>
17
+ <%= link_to @event.library.display_name, @event.library -%>
18
18
  </p>
19
19
 
20
20
  <%- if @event.all_day -%>
@@ -4,7 +4,7 @@
4
4
  <p id="notice"><%= notice %></p>
5
5
 
6
6
  <h2 class="resource_title">
7
- <%= @event.display_name.localize -%>
7
+ <%= @event.display_name -%>
8
8
  </h2>
9
9
 
10
10
  <p>
@@ -14,12 +14,12 @@
14
14
 
15
15
  <p>
16
16
  <strong><%= t('activerecord.models.event_category') -%>:</strong>
17
- <%= @event.event_category.display_name.localize -%>
17
+ <%= @event.event_category.display_name -%>
18
18
  </p>
19
19
 
20
20
  <p>
21
21
  <strong><%= t('activerecord.models.library') -%>:</strong>
22
- <%= link_to @event.library.display_name.localize, @event.library -%>
22
+ <%= link_to @event.library.display_name, @event.library -%>
23
23
  </p>
24
24
 
25
25
  <p>
@@ -3,14 +3,14 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <%- if @library -%>
6
- <title><%= t('calendar.library_calendar', library_name: @library.display_name.localize) -%> - <%= LibraryGroup.system_name(@locale) -%></title>
6
+ <title><%= t('calendar.library_calendar', library_name: @library.display_name) -%> - <%= LibraryGroup.system_name(@locale) -%></title>
7
7
  <%- else -%>
8
8
  <title><%= t('calendar.calendar') -%> - <%= LibraryGroup.system_name(@locale) -%></title>
9
9
  <%- end -%>
10
10
  <%= render 'page/include' -%>
11
- <%= auto_discovery_link_tag(:rss, events_url(format: :rss), title: (t('event.library_group_event', library_group_name: @library_group.display_name.localize) + " (RSS)")) %>
12
- <%= auto_discovery_link_tag(:atom, events_url(format: :atom), title: (t('event.library_group_event', library_group_name: @library_group.display_name.localize) + " (Atom)")) %>
13
- <link rel="search" type="application/opensearchdescription+xml" href="<%= page_opensearch_url -%>" title="<%= @library_group.display_name.localize -%>" />
11
+ <%= auto_discovery_link_tag(:rss, events_url(format: :rss), title: (t('event.library_group_event', library_group_name: @library_group.display_name) + " (RSS)")) %>
12
+ <%= auto_discovery_link_tag(:atom, events_url(format: :atom), title: (t('event.library_group_event', library_group_name: @library_group.display_name) + " (Atom)")) %>
13
+ <link rel="search" type="application/opensearchdescription+xml" href="<%= page_opensearch_url -%>" title="<%= @library_group.display_name -%>" />
14
14
  </head>
15
15
  <body>
16
16
 
@@ -11,7 +11,7 @@
11
11
  <%- @participates.each do |participate| %>
12
12
  <tr class="line<%= cycle("0", "1") -%>">
13
13
  <td><%= link_to participate.agent.full_name, participate.agent %>
14
- <td><%= link_to participate.event.display_name.localize, participate.event %>
14
+ <td><%= link_to participate.event.display_name, participate.event %>
15
15
  <td><%= link_to t('page.show'), participate %></td>
16
16
  <td><%= link_to t('page.edit'), edit_participate_path(participate) %></td>
17
17
  <td><%= link_to t('page.destroy'), participate, data: {confirm: t('page.are_you_sure')}, method: :delete %></td>
@@ -10,7 +10,7 @@
10
10
 
11
11
  <p>
12
12
  <strong><%= t('activerecord.models.event') -%>:</strong>
13
- <%= link_to @participate.event.display_name.localize, @participate.event %>
13
+ <%= link_to @participate.event.display_name, @participate.event %>
14
14
  </p>
15
15
 
16
16
  </div>
@@ -3,7 +3,7 @@
3
3
  <div id="content_list">
4
4
  <p id="notice"><%= notice %></p>
5
5
 
6
- <h2 class="resource_title"><%= link_to event.display_name.localize, event -%></h2>
6
+ <h2 class="resource_title"><%= link_to event.display_name, event -%></h2>
7
7
 
8
8
  <table class="table table-striped index">
9
9
  <tr>
@@ -38,7 +38,6 @@ en:
38
38
  default_event_category_id: Default event category
39
39
  event_import_result:
40
40
  body: Body
41
- lineno: Line
42
41
  event_export_file:
43
42
  event_export_file_name: Filename
44
43
  event_export_file_size: Size
@@ -38,7 +38,6 @@ ja:
38
38
  default_event_category_id: 既定の催し物の種別
39
39
  event_import_result:
40
40
  body: 本文
41
- lineno: 行数
42
41
  event_export_file:
43
42
  event_export_file_name: ファイル名
44
43
  event_export_file_size: ファイルサイズ
@@ -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
@@ -2,6 +2,7 @@ require "enju_message"
2
2
  require "ri_cal"
3
3
  require "csv"
4
4
  require "nkf"
5
+ require "jbuilder"
5
6
  begin
6
7
  require 'charlock_holmes/string'
7
8
  rescue LoadError
@@ -1,3 +1,3 @@
1
1
  module EnjuEvent
2
- VERSION = "0.3.5".freeze
2
+ VERSION = "0.4.0.beta.1"
3
3
  end
@@ -5,10 +5,10 @@ class EnjuEvent::SetupGenerator < Rails::Generators::Base
5
5
  directory("db/fixtures", "db/fixtures/enju_event")
6
6
  rake("enju_event_engine:install:migrations")
7
7
  inject_into_file 'app/controllers/application_controller.rb',
8
- " include EnjuEvent::Controller\n", after: "include EnjuLibrary::Controller\n"
8
+ " enju_event\n", after: "enju_library\n"
9
9
  inject_into_file 'app/assets/stylesheets/application.css',
10
- " *= require enju_event/application\n", after: " *= require enju_leaf\n"
10
+ " *= require enju_event/application\n", after: " *= require enju_leaf/application\n"
11
11
  inject_into_file 'app/assets/javascripts/application.js',
12
- "//= require enju_event/application\n", after: "//= require enju_leaf\n"
12
+ "//= require enju_event/application\n", after: "//= require enju_leaf/application\n"
13
13
  end
14
14
  end
@@ -1,15 +1,44 @@
1
1
  ---
2
2
  event_category_00001:
3
- name: unknown
4
- display_name: "en: unknown\r\n\
5
- ja: 不明"
3
+ name: unknown
4
+ display_name_translations: {"en": "(not specified)", "ja": "未定"}
6
5
  id: 1
7
6
  note: ""
8
7
  position: 1
9
8
  event_category_00002:
10
- name: closed
11
- display_name: "en: closed\r\n\
12
- ja: 休館日"
9
+ name: closed
10
+ display_name_translations: {"en": "closed", "ja": "休館日"}
13
11
  id: 2
14
12
  note: ""
15
13
  position: 2
14
+ event_category_00003:
15
+ name: book_talk
16
+ display_name_translations: {"en": "talk event", "ja": "おはなし会"}
17
+ id: 3
18
+ note: ""
19
+ position: 3
20
+ event_category_00004:
21
+ name: movie_theater
22
+ display_name_translations: {"en": "screening", "ja": "上映会"}
23
+ id: 4
24
+ note: ""
25
+ position: 4
26
+ event_category_00005:
27
+ name: talk_event
28
+ display_name_translations: {"en": "seminar", "ja": "講演会"}
29
+ id: 5
30
+ note: ""
31
+ position: 5
32
+
33
+ # == Schema Information
34
+ #
35
+ # Table name: event_categories
36
+ #
37
+ # id :bigint not null, primary key
38
+ # name :string not null
39
+ # display_name_translations :jsonb not null
40
+ # note :text
41
+ # position :integer default(1), not null
42
+ # created_at :datetime not null
43
+ # updated_at :datetime not null
44
+ #
@@ -9,7 +9,7 @@ describe EventImportResultsController do
9
9
 
10
10
  it "assigns all event_import_results as @event_import_results" do
11
11
  get :index
12
- assigns(:event_import_results).should eq(EventImportResult.order(created_at: :desc).page(1))
12
+ assigns(:event_import_results).should eq(EventImportResult.page(1))
13
13
  end
14
14
  end
15
15
 
@@ -18,7 +18,7 @@ describe EventImportResultsController do
18
18
 
19
19
  it "assigns all event_import_results as @event_import_results" do
20
20
  get :index
21
- assigns(:event_import_results).should eq(EventImportResult.order(created_at: :desc).page(1))
21
+ assigns(:event_import_results).should eq(EventImportResult.page(1))
22
22
  end
23
23
  end
24
24
 
@@ -55,8 +55,8 @@ describe EventsController do
55
55
  assigns(:events).should_not be_nil
56
56
  end
57
57
 
58
- it "assigns all events as @events in text format" do
59
- get :index, format: :text
58
+ it "assigns all events as @events in txt format" do
59
+ get :index, format: 'txt'
60
60
  assigns(:events).should_not be_nil
61
61
  end
62
62
 
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3
3
  load Gem.bin_path('bundler', 'bundle')
data/spec/dummy/bin/setup CHANGED
@@ -1,10 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
- require 'pathname'
3
2
  require 'fileutils'
4
3
  include FileUtils
5
4
 
6
5
  # path to your application root.
7
- APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+ APP_ROOT = File.expand_path('..', __dir__)
8
7
 
9
8
  def system!(*args)
10
9
  system(*args) || abort("\n== Command #{args} failed ==")
@@ -21,7 +20,6 @@ chdir APP_ROOT do
21
20
  # Install JavaScript dependencies if using Yarn
22
21
  # system('bin/yarn')
23
22
 
24
-
25
23
  # puts "\n== Copying sample files =="
26
24
  # unless File.exist?('config/database.yml')
27
25
  # cp 'config/database.yml.sample', 'config/database.yml'
@@ -1,10 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
- require 'pathname'
3
2
  require 'fileutils'
4
3
  include FileUtils
5
4
 
6
5
  # path to your application root.
7
- APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+ APP_ROOT = File.expand_path('..', __dir__)
8
7
 
9
8
  def system!(*args)
10
9
  system(*args) || abort("\n== Command #{args} failed ==")
@@ -18,6 +17,9 @@ chdir APP_ROOT do
18
17
  system! 'gem install bundler --conservative'
19
18
  system('bundle check') || system!('bundle install')
20
19
 
20
+ # Install JavaScript dependencies if using Yarn
21
+ # system('bin/yarn')
22
+
21
23
  puts "\n== Updating database =="
22
24
  system! 'bin/rails db:migrate'
23
25
 
data/spec/dummy/bin/yarn CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
- VENDOR_PATH = File.expand_path('..', __dir__)
3
- Dir.chdir(VENDOR_PATH) do
2
+ APP_ROOT = File.expand_path('..', __dir__)
3
+ Dir.chdir(APP_ROOT) do
4
4
  begin
5
- exec "yarnpkg #{ARGV.join(" ")}"
5
+ exec "yarnpkg", *ARGV
6
6
  rescue Errno::ENOENT
7
7
  $stderr.puts "Yarn executable was not detected in the system."
8
8
  $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
@@ -1,25 +1,86 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
1
+ # PostgreSQL. Versions 9.1 and up are supported.
3
2
  #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
3
+ # Install the pg driver:
4
+ # gem install pg
5
+ # On OS X with Homebrew:
6
+ # gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7
+ # On OS X with MacPorts:
8
+ # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
9
+ # On Windows:
10
+ # gem install pg
11
+ # Choose the win32 build.
12
+ # Install PostgreSQL and put its /bin directory on your path.
13
+ #
14
+ # Configure Using Gemfile
15
+ # gem 'pg'
6
16
  #
7
17
  default: &default
8
- adapter: sqlite3
18
+ adapter: postgresql
19
+ encoding: unicode
20
+ # For details on connection pooling, see rails configuration guide
21
+ # http://guides.rubyonrails.org/configuring.html#database-pooling
9
22
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
- timeout: 5000
23
+ username: postgres
11
24
 
12
25
  development:
13
26
  <<: *default
14
- database: db/development.sqlite3
27
+ database: enju_event_dummy_development
28
+
29
+ # The specified database role being used to connect to postgres.
30
+ # To create additional roles in postgres see `$ createuser --help`.
31
+ # When left blank, postgres will use the default role. This is
32
+ # the same name as the operating system user that initialized the database.
33
+ #username: dummy
34
+
35
+ # The password associated with the postgres role (username).
36
+ #password:
37
+
38
+ # Connect on a TCP socket. Omitted by default since the client uses a
39
+ # domain socket that doesn't need configuration. Windows does not have
40
+ # domain sockets, so uncomment these lines.
41
+ #host: localhost
42
+
43
+ # The TCP port the server listens on. Defaults to 5432.
44
+ # If your server runs on a different port number, change accordingly.
45
+ #port: 5432
46
+
47
+ # Schema search path. The server defaults to $user,public
48
+ #schema_search_path: myapp,sharedapp,public
49
+
50
+ # Minimum log levels, in increasing order:
51
+ # debug5, debug4, debug3, debug2, debug1,
52
+ # log, notice, warning, error, fatal, and panic
53
+ # Defaults to warning.
54
+ #min_messages: notice
15
55
 
16
56
  # Warning: The database defined as "test" will be erased and
17
57
  # re-generated from your development database when you run "rake".
18
58
  # Do not set this db to the same as development or production.
19
59
  test:
20
60
  <<: *default
21
- database: db/test.sqlite3
61
+ database: enju_event_dummy_test
22
62
 
63
+ # As with config/secrets.yml, you never want to store sensitive information,
64
+ # like your database password, in your source code. If your source code is
65
+ # ever seen by anyone, they now have access to your database.
66
+ #
67
+ # Instead, provide the password as a unix environment variable when you boot
68
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
69
+ # for a full rundown on how to provide these environment variables in a
70
+ # production deployment.
71
+ #
72
+ # On Heroku and other platform providers, you may have a full connection URL
73
+ # available as an environment variable. For example:
74
+ #
75
+ # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
76
+ #
77
+ # You can use this database configuration with:
78
+ #
79
+ # production:
80
+ # url: <%= ENV['DATABASE_URL'] %>
81
+ #
23
82
  production:
24
83
  <<: *default
25
- database: db/production.sqlite3
84
+ database: enju_event_dummy_production
85
+ username: dummy
86
+ password: <%= ENV['DUMMY_DATABASE_PASSWORD'] %>
@@ -6,7 +6,7 @@ Rails.application.config.assets.version = '1.0'
6
6
  # Add additional assets to the asset load path.
7
7
  # Rails.application.config.assets.paths << Emoji.images_path
8
8
  # Add Yarn node_modules folder to the asset load path.
9
- Rails.application.config.assets.paths << Rails.root.join('node_modules')
9
+ Rails.application.config.assets.paths << Rails.root.join('../../', 'node_modules')
10
10
 
11
11
  # Precompile additional assets.
12
12
  # application.js, application.css, and all non-JS/CSS in the app/assets
@@ -2,4 +2,3 @@
2
2
 
3
3
  # Add new mime types for use in respond_to blocks:
4
4
  # Mime::Type.register "text/richtext", :rtf
5
- Mime::Type.register_alias "text/plain", :txt
@@ -2,19 +2,15 @@ class CreateMessages < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :messages, force: true do |t|
4
4
  t.datetime :read_at
5
- t.integer :receiver_id, :sender_id
5
+ t.references :sender, index: true
6
+ t.references :receiver, index: true
6
7
  t.string :subject, null: false
7
8
  t.text :body
8
- t.integer :message_request_id
9
- t.integer :parent_id
9
+ t.references :message_request, index: true
10
+ t.references :parent, index: true
10
11
 
11
12
  t.timestamps
12
13
  end
13
-
14
- add_index :messages, :sender_id
15
- add_index :messages, :receiver_id
16
- add_index :messages, :message_request_id
17
- add_index :messages, :parent_id
18
14
  end
19
15
 
20
16
  def self.down
@@ -1,9 +1,9 @@
1
1
  class CreateMessageRequests < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :message_requests do |t|
4
- t.integer :sender_id
5
- t.integer :receiver_id
6
- t.integer :message_template_id
4
+ t.references :sender
5
+ t.references :receiver
6
+ t.references :message_template
7
7
  t.datetime :sent_at
8
8
  t.datetime :deleted_at
9
9
  t.text :body
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForMessageTransitions < ActiveRecord::Migration[5.2]
1
+ class AddConstraintsToMostRecentForMessageTransitions < ActiveRecord::Migration[4.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForMessageRequestTransitions < ActiveRecord::Migration[5.2]
1
+ class AddConstraintsToMostRecentForMessageRequestTransitions < ActiveRecord::Migration[4.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -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,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
@@ -0,0 +1,5 @@
1
+ class AddProfileIdToUser < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_reference :users, :profile, foreign_key: true
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddFullNameTranslationsToProfile < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :profiles, :full_name_translations, :jsonb, default: {}, null: false
4
+ end
5
+ end