enju_library 0.4.0.beta.2 → 0.4.0.beta.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1c75319a25ae87f9ea02f08f1162def1502216acb8c4b8f9287f25e1e210b6a
4
- data.tar.gz: ec1be62fc92d1a8ec899cf5e14ad5fe20afcc05a37b2338df7e139eebd831a7e
3
+ metadata.gz: c54fee8cd84328f868debaa6c64e28588747726f283e85e75be1c2ecf6ef660f
4
+ data.tar.gz: 9262905b121b7c27b671c2565133d05e679a6a08bb23300859ba1c080d07a874
5
5
  SHA512:
6
- metadata.gz: 836f596b0f34970787d4ae1c36d95a584b00b4c13a1d5cc7a1908396e125546fd6b60c5f52b6373823b998e3f030a469b6269d90f0962557fb91430195d505ae
7
- data.tar.gz: 3a291af12182dc72a64b24da112bbde2931902f85c0ea575ee4da498199d6dd5376aba2a72129c4602c04717924bc5f4f6cf025779aa8cf9bdb306738c025391
6
+ metadata.gz: 39c767eb420d164c689aa671d89135cd2bd5628614bad760af0d3373444489fe58e46d5f40f2782f136e03b45f5738e560cfe10e82b576c6e1e7ec2c4f67b9ce
7
+ data.tar.gz: bda1aa09293cb8038d6ceeff9f249de5b3a62633f9a23ae5c763c3d0cd9c2a321503a32a0d6a5e256ba2053c13d6d19ad862b9e17e73e232cf483b427d4f412a
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # EnjuLibrary
2
- [![CircleCI](https://circleci.com/gh/next-l/enju_library/tree/2.x.svg?style=svg)](https://circleci.com/gh/next-l/enju_library/tree/2.x)
2
+ ![](https://github.com/next-l/enju_library/workflows/Ruby/badge.svg?branch=2.x)
3
3
  [![Coverage Status](https://coveralls.io/repos/github/next-l/enju_library/badge.svg?branch=2.x)](https://coveralls.io/github/next-l/enju_library?branch=2.x)
4
4
 
5
5
  This project rocks and uses MIT-LICENSE.
@@ -1,5 +1,8 @@
1
1
  class UserExportFile < ApplicationRecord
2
- include Statesman::Adapters::ActiveRecordQueries
2
+ include Statesman::Adapters::ActiveRecordQueries[
3
+ transition_class: UserExportFileTransition,
4
+ initial_state: :pending
5
+ ]
3
6
  include ExportFile
4
7
 
5
8
  if ENV['ENJU_STORAGE'] == 's3'
@@ -1,5 +1,8 @@
1
1
  class UserImportFile < ApplicationRecord
2
- include Statesman::Adapters::ActiveRecordQueries
2
+ include Statesman::Adapters::ActiveRecordQueries[
3
+ transition_class: UserImportFileTransition,
4
+ initial_state: :pending
5
+ ]
3
6
  include ImportFile
4
7
  default_scope {order('user_import_files.id DESC')}
5
8
  scope :not_imported, -> { in_state(:pending) }
@@ -2,11 +2,7 @@ class CreateUserImportFileTransitions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :user_import_file_transitions do |t|
4
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
5
+ t.text :metadata, default: "{}"
10
6
  t.integer :sort_key
11
7
  t.references :user_import_file, index: true
12
8
  t.timestamps
@@ -2,11 +2,7 @@ class CreateUserExportFileTransitions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :user_export_file_transitions do |t|
4
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
5
+ t.text :metadata, default: "{}"
10
6
  t.integer :sort_key
11
7
  t.references :user_export_file, index: true
12
8
  t.timestamps
@@ -1,3 +1,3 @@
1
1
  module EnjuLibrary
2
- VERSION = "0.4.0.beta.2"
2
+ VERSION = "0.4.0.beta.3"
3
3
  end
@@ -17,8 +17,8 @@ namespace :enju_library do
17
17
  Shelf.create!(name: 'first_shelf', library: Library.find_by(name: 'yours'))
18
18
  end
19
19
 
20
- desc "upgrade enju_library"
21
- task :upgrade => :environment do
20
+ desc "upgrade enju_library to 1.3"
21
+ task :upgrade_to_13 => :environment do
22
22
  Rake::Task['statesman:backfill_most_recent'].invoke('UserExportFile')
23
23
  Rake::Task['statesman:backfill_most_recent'].invoke('UserImportFile')
24
24
  library_group = LibraryGroup.site_config
@@ -46,4 +46,32 @@ EOS
46
46
  library_group.save
47
47
  puts 'enju_library: The upgrade completed successfully.'
48
48
  end
49
+
50
+ desc "upgrade enju_biblio to 2.0"
51
+ task upgrade: :environment do
52
+ class_names = [
53
+ BudgetType, Library, LibraryGroup, RequestStatusType, RequestType,
54
+ SearchEngine, Shelf, UserGroup
55
+ ]
56
+ class_names.each do |klass|
57
+ klass.find_each do |record|
58
+ I18n.available_locales.each do |locale|
59
+ next unless record.respond_to?("display_name_#{locale}")
60
+ record.update("display_name_#{locale}": YAML.safe_load(record[:display_name])[locale.to_s])
61
+ end
62
+ end
63
+ end
64
+
65
+ sql = 'SELECT * FROM library_group_translations;'
66
+ results = ActiveRecord::Base.connection.execute(sql)
67
+ results.each do |row|
68
+ library_group = LibraryGroup.find(row['library_group_id'])
69
+ library_group.update(
70
+ "login_banner_#{row['locale']}": row['login_banner'],
71
+ "footer_banner_#{row['locale']}": row['footer_banner']
72
+ )
73
+ end
74
+
75
+ puts 'enju_library: The upgrade completed successfully.'
76
+ end
49
77
  end
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_library
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.beta.2
4
+ version: 0.4.0.beta.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kosuke Tanabe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-17 00:00:00.000000000 Z
11
+ date: 2019-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: enju_seed
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.4.0.beta.1
117
+ version: 0.4.0.beta.2
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 0.4.0.beta.1
124
+ version: 0.4.0.beta.2
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: pg
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -569,6 +569,7 @@ files:
569
569
  - spec/controllers/withdraws_controller_spec.rb
570
570
  - spec/dummy/README.rdoc
571
571
  - spec/dummy/Rakefile
572
+ - spec/dummy/app/assets/config/manifest.js
572
573
  - spec/dummy/app/assets/javascripts/application.js
573
574
  - spec/dummy/app/assets/stylesheets/application.css
574
575
  - spec/dummy/app/controllers/application_controller.rb
@@ -1013,6 +1014,7 @@ test_files:
1013
1014
  - spec/dummy/app/jobs/application_job.rb
1014
1015
  - spec/dummy/app/controllers/application_controller.rb
1015
1016
  - spec/dummy/app/views/layouts/application.html.erb
1017
+ - spec/dummy/app/assets/config/manifest.js
1016
1018
  - spec/dummy/app/assets/javascripts/application.js
1017
1019
  - spec/dummy/app/assets/stylesheets/application.css
1018
1020
  - spec/dummy/app/helpers/application_helper.rb