Skip to content

Commit

Permalink
Update active_storage migrations and configure manifest.js
Browse files Browse the repository at this point in the history
  • Loading branch information
galetahub committed Jul 2, 2024
1 parent 08cf037 commit e52aaf7
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 15 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ gem 'rails', '~> 6.1'
platforms :ruby do
gem 'sass'
gem 'sqlite3'
gem 'sprockets'
gem 'sprockets-rails'
gem 'sassc'

group :development, :test do
gem 'capybara'
Expand Down
5 changes: 4 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ GEM
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.4.0)
ffi (~> 1.9)
shrine (3.6.0)
content_disposition (~> 1.0)
down (~> 5.1)
Expand Down Expand Up @@ -271,9 +273,10 @@ DEPENDENCIES
rails (~> 6.1)
rubocop-rails
sass
sassc
shrine
shrine-mongoid
sprockets
sprockets-rails
sqlite3

BUNDLED WITH
Expand Down
7 changes: 7 additions & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//= link_tree ../images

//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css

//= link ckeditor/application.css
//= link application.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class CreateCkeditorAssets < ActiveRecord::Migration[5.2]
class CreateCkeditorAssets < ActiveRecord::Migration[6.1]
def up
create_table :ckeditor_assets do |t|
t.string :data_file_name, null: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class CreateCkeditorAssets < ActiveRecord::Migration[5.2]
class CreateCkeditorAssets < ActiveRecord::Migration[6.1]
def up
create_table :ckeditor_assets do |t|
t.string :data_file_name, null: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class CreateCkeditorAssets < ActiveRecord::Migration[5.2]
class CreateCkeditorAssets < ActiveRecord::Migration[6.1]
def up
create_table :ckeditor_assets do |t|
t.string :data_uid, null: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class CreateCkeditorAssets < ActiveRecord::Migration[5.2]
class CreateCkeditorAssets < ActiveRecord::Migration[6.1]
def up
create_table :ckeditor_assets do |t|
t.string :data_file_name, null: false
Expand Down
1 change: 0 additions & 1 deletion test/controllers/attachment_files_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def teardown
get :index

assert_equal 200, @response.status
assert_template 'ckeditor/attachment_files/index'
end

test 'create action via filebrowser' do
Expand Down
1 change: 0 additions & 1 deletion test/controllers/pictures_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def teardown
get :index

assert_equal 200, @response.status
assert_template 'ckeditor/pictures/index'
end

test 'create action via filebrowser' do
Expand Down
4 changes: 3 additions & 1 deletion test/dummy/app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css

//= link ckeditor/application.css
//= link application.css
2 changes: 0 additions & 2 deletions test/dummy/app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
2 changes: 2 additions & 0 deletions test/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@
config.active_support.deprecation = :stderr

config.active_support.test_order = :sorted

config.assets.precompile += %w( ckeditor/application.css ckeditor/application.js application.css )
end
2 changes: 1 addition & 1 deletion test/dummy/db/migrate/20110623120047_create_posts.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class CreatePosts < ActiveRecord::Migration[5.2]
class CreatePosts < ActiveRecord::Migration[6.1]
def up
create_table :posts do |t|
t.string :title
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
class CreateActiveStorageTables < ActiveRecord::Migration[6.1]
def change
create_table :active_storage_blobs do |t|
t.string :key, null: false
Expand All @@ -8,6 +8,7 @@ def change
t.bigint :byte_size, null: false
t.string :checksum, null: false
t.datetime :created_at, null: false
t.string :service_name, null: false

t.index [ :key ], unique: true
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This migration comes from active_storage (originally 20191206030411)
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.1]
def up
create_table :active_storage_variant_records do |t|
t.belongs_to :blob, null: false, index: false
t.string :variation_digest, null: false

t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness",
unique: true
t.foreign_key :active_storage_blobs, column: :blob_id
end
end
end
3 changes: 2 additions & 1 deletion test/orm/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ def activerecord_below_5_2?
if activerecord_below_5_2?
ActiveRecord::Migrator.migrate('test/dummy/db/migrate')
else
ActiveRecord::MigrationContext.new('test/dummy/db/migrate').migrate
schema_migration = ActiveRecord::Base.connection.schema_migration
ActiveRecord::MigrationContext.new('test/dummy/db/migrate', schema_migration).migrate
end
1 change: 0 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

require File.expand_path('../dummy/config/environment.rb', __FILE__)
require 'rails/test_help'
require 'redgreen'

Rails.backtrace_cleaner.remove_silencers!

Expand Down

0 comments on commit e52aaf7

Please sign in to comment.