cmor_galleries 0.0.1.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +44 -0
- data/Rakefile +19 -0
- data/app/assets/config/cmor_galleries_manifest.js +2 -0
- data/app/assets/javascripts/cmor/galleries/application/keep.js +0 -0
- data/app/assets/javascripts/cmor/galleries/application.js +14 -0
- data/app/assets/stylesheets/cmor/galleries/application/keep.css +0 -0
- data/app/assets/stylesheets/cmor/galleries/application.css +15 -0
- data/app/controllers/cmor/galleries/application_controller.rb +5 -0
- data/app/controllers/cmor/galleries/application_resources_controller.rb +11 -0
- data/app/controllers/cmor/galleries/picture_galleries_controller.rb +17 -0
- data/app/models/cmor/galleries/application_record.rb +5 -0
- data/app/models/cmor/galleries/picture_detail.rb +26 -0
- data/app/models/cmor/galleries/picture_gallery.rb +88 -0
- data/app/view_helpers/cmor/galleries/galleries_helper.rb +34 -0
- data/app/view_helpers/cmor/galleries/pictures_helper.rb +37 -0
- data/app/views/cmor/galleries/galleries_helper/_render.html.haml +17 -0
- data/app/views/cmor/galleries/picture_galleries/index.html.haml +16 -0
- data/app/views/cmor/galleries/picture_galleries/show.html.haml +18 -0
- data/app/views/cmor/galleries/pictures_helper/_render.html.haml +15 -0
- data/app/views/layouts/cmor/galleries/application.html.erb +14 -0
- data/config/initializers/assets.rb +1 -0
- data/config/locales/de.yml +48 -0
- data/config/locales/en.yml +46 -0
- data/config/routes.rb +9 -0
- data/db/migrate/20180301153325_create_cmor_galleries_picture_galleries.rb +11 -0
- data/db/migrate/20180302082402_create_cmor_galleries_picture_details.rb +14 -0
- data/lib/cmor/galleries/configuration.rb +12 -0
- data/lib/cmor/galleries/engine.rb +13 -0
- data/lib/cmor/galleries/version.rb +7 -0
- data/lib/cmor/galleries.rb +10 -0
- data/lib/cmor_galleries.rb +7 -0
- data/lib/generators/cmor/galleries/install/install_generator.rb +24 -0
- data/lib/generators/cmor/galleries/install/templates/initializer.rb +27 -0
- data/lib/generators/cmor/galleries/install/templates/routes.source +3 -0
- data/lib/tasks/cmor_galleries_tasks.rake +4 -0
- data/spec/dummy/config/initializers/cmor_galleries.rb +27 -0
- data/spec/dummy/config/initializers/i18n.rb +2 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20190325174835_create_active_storage_tables.active_storage.rb +27 -0
- data/spec/dummy/db/migrate/20190325174856_create_cmor_galleries_picture_galleries.cmor_galleries.rb +12 -0
- data/spec/dummy/db/migrate/20190325174857_create_cmor_galleries_picture_details.cmor_galleries.rb +15 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +122 -0
- data/spec/dummy/log/test.log +143 -0
- data/spec/dummy/tmp/development_secret.txt +1 -0
- data/spec/dummy/tmp/storage/B8/o7/B8o7CDJi1ubYmEcP3ZAGkEiM +0 -0
- data/spec/dummy/tmp/storage/Hp/aX/HpaXaXSTTBQhyk9pwjiXNpvs +0 -0
- data/spec/factories/cmor_galleries_picture_details.rb +17 -0
- data/spec/factories/cmor_galleries_picture_galleries.rb +5 -0
- data/spec/files/cmor/galleries/picture_details/example.png +0 -0
- data/spec/models/cmor/galleries/picture_detail_spec.rb +7 -0
- data/spec/models/cmor/galleries/picture_gallery_spec.rb +8 -0
- data/spec/models/generic_spec.rb +50 -0
- data/spec/models/i18n_spec.rb +41 -0
- data/spec/rails_helper.rb +62 -0
- data/spec/rails_helper.rb~ +58 -0
- data/spec/spec_helper.rb +96 -0
- data/spec/spec_helper.rb~ +96 -0
- data/spec/support/capybara.rb +1 -0
- data/spec/support/factory_bot.rb +5 -0
- data/spec/support/rao-shoulda_matchers.rb +5 -0
- data/spec/support/shoulda_matchers.rb +8 -0
- data/spec/support~/factory_bot_rails.rb +11 -0
- data/spec/support~/shoulda_matchers.rb +8 -0
- metadata +430 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
module Cmor::Galleries
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
desc 'Generates the initializer'
|
5
|
+
|
6
|
+
source_root File.expand_path('../templates', __FILE__)
|
7
|
+
|
8
|
+
attr_reader :base_controller_class_name
|
9
|
+
|
10
|
+
def initialize(*args)
|
11
|
+
super
|
12
|
+
@base_controller_class_name = ENV.fetch('BASE_CONTROLLER_CLASS_NAME') { '::ApplicationController' }
|
13
|
+
end
|
14
|
+
|
15
|
+
def generate_initializer
|
16
|
+
template 'initializer.rb', 'config/initializers/cmor_galleries.rb'
|
17
|
+
end
|
18
|
+
|
19
|
+
def generate_routes
|
20
|
+
route File.read(File.join(File.expand_path('../templates', __FILE__), 'routes.source'))
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Cmor::Galleries.configure do |config|
|
2
|
+
# Set the base controller for the page controller
|
3
|
+
#
|
4
|
+
# Default: config.base_controller = '<%= base_controller_class_name %>'
|
5
|
+
#
|
6
|
+
config.base_controller = '<%= base_controller_class_name %>'
|
7
|
+
|
8
|
+
# These options are the defaults that will be applied to when rendering
|
9
|
+
# galleries through the galleries helper.
|
10
|
+
#
|
11
|
+
# Default: config.galleries_helper_render_default_options = { variant_options: {}, show_details: false }
|
12
|
+
#
|
13
|
+
config.galleries_helper_render_default_options = { variant_options: {}, show_details: false }
|
14
|
+
|
15
|
+
# These options are the defaults that will be applied to when rendering
|
16
|
+
# pictures through the pictures helper.
|
17
|
+
#
|
18
|
+
# Default: config.pictures_helper_render_default_options = { image_tag_only: true }
|
19
|
+
#
|
20
|
+
config.pictures_helper_render_default_options = { image_tag_only: true }
|
21
|
+
|
22
|
+
# This options will be applied when rendering thumbails in galleries.
|
23
|
+
#
|
24
|
+
# Default: config.thumbnail_variant_options = { combine_options: { resize: "384x216^", extent: "384x216", gravity: "center" } }
|
25
|
+
#
|
26
|
+
config.thumbnail_variant_options = { combine_options: { resize: "384x216^", extent: "384x216", gravity: "center" } }
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Cmor::Galleries.configure do |config|
|
2
|
+
# Set the base controller for the page controller
|
3
|
+
#
|
4
|
+
# Default: config.base_controller = '::ApplicationController'
|
5
|
+
#
|
6
|
+
config.base_controller = '::ApplicationController'
|
7
|
+
|
8
|
+
# These options are the defaults that will be applied to when rendering
|
9
|
+
# galleries through the galleries helper.
|
10
|
+
#
|
11
|
+
# Default: config.galleries_helper_render_default_options = { variant_options: {}, show_details: false }
|
12
|
+
#
|
13
|
+
config.galleries_helper_render_default_options = { variant_options: {}, show_details: false }
|
14
|
+
|
15
|
+
# These options are the defaults that will be applied to when rendering
|
16
|
+
# pictures through the pictures helper.
|
17
|
+
#
|
18
|
+
# Default: config.pictures_helper_render_default_options = { image_tag_only: true }
|
19
|
+
#
|
20
|
+
config.pictures_helper_render_default_options = { image_tag_only: true }
|
21
|
+
|
22
|
+
# This options will be applied when rendering thumbails in galleries.
|
23
|
+
#
|
24
|
+
# Default: config.thumbnail_variant_options = { combine_options: { resize: "384x216^", extent: "384x216", gravity: "center" } }
|
25
|
+
#
|
26
|
+
config.thumbnail_variant_options = { combine_options: { resize: "384x216^", extent: "384x216", gravity: "center" } }
|
27
|
+
end
|
Binary file
|
@@ -0,0 +1,27 @@
|
|
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
|
data/spec/dummy/db/migrate/20190325174856_create_cmor_galleries_picture_galleries.cmor_galleries.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from cmor_galleries (originally 20180301153325)
|
2
|
+
class CreateCmorGalleriesPictureGalleries < ActiveRecord::Migration[5.2]
|
3
|
+
def change
|
4
|
+
create_table :cmor_galleries_picture_galleries do |t|
|
5
|
+
t.string :name
|
6
|
+
t.timestamp :published_at
|
7
|
+
t.text :description
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/spec/dummy/db/migrate/20190325174857_create_cmor_galleries_picture_details.cmor_galleries.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# This migration comes from cmor_galleries (originally 20180302082402)
|
2
|
+
class CreateCmorGalleriesPictureDetails < ActiveRecord::Migration[5.2]
|
3
|
+
def change
|
4
|
+
create_table :cmor_galleries_picture_details do |t|
|
5
|
+
t.integer :picture_gallery_id
|
6
|
+
t.integer :asset_id
|
7
|
+
t.string :title
|
8
|
+
t.text :description
|
9
|
+
t.integer :position
|
10
|
+
t.timestamp :published_at
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
Binary file
|
@@ -0,0 +1,122 @@
|
|
1
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
2
|
+
↳ bin/rails:4
|
3
|
+
[1m[35m (6.6ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)[0m
|
4
|
+
↳ bin/rails:4
|
5
|
+
[1m[35m (19.7ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
6
|
+
↳ bin/rails:4
|
7
|
+
[1m[35m (0.4ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
8
|
+
↳ bin/rails:4
|
9
|
+
Migrating to CreateActiveStorageTables (20190325174835)
|
10
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
11
|
+
↳ bin/rails:4
|
12
|
+
[1m[35m (1.0ms)[0m [1m[35mCREATE TABLE "active_storage_blobs" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar NOT NULL, "filename" varchar NOT NULL, "content_type" varchar, "metadata" text, "byte_size" bigint NOT NULL, "checksum" varchar NOT NULL, "created_at" datetime NOT NULL)[0m
|
13
|
+
↳ db/migrate/20190325174835_create_active_storage_tables.active_storage.rb:4
|
14
|
+
[1m[35m (0.6ms)[0m [1m[35mCREATE UNIQUE INDEX "index_active_storage_blobs_on_key" ON "active_storage_blobs" ("key")[0m
|
15
|
+
↳ db/migrate/20190325174835_create_active_storage_tables.active_storage.rb:4
|
16
|
+
[1m[35m (0.4ms)[0m [1m[35mCREATE TABLE "active_storage_attachments" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "record_type" varchar NOT NULL, "record_id" integer NOT NULL, "blob_id" integer NOT NULL, "created_at" datetime NOT NULL, CONSTRAINT "fk_rails_c3b3935057"
|
17
|
+
FOREIGN KEY ("blob_id")
|
18
|
+
REFERENCES "active_storage_blobs" ("id")
|
19
|
+
)[0m
|
20
|
+
↳ db/migrate/20190325174835_create_active_storage_tables.active_storage.rb:16
|
21
|
+
[1m[35m (0.3ms)[0m [1m[35mCREATE INDEX "index_active_storage_attachments_on_blob_id" ON "active_storage_attachments" ("blob_id")[0m
|
22
|
+
↳ db/migrate/20190325174835_create_active_storage_tables.active_storage.rb:16
|
23
|
+
[1m[35m (0.4ms)[0m [1m[35mCREATE UNIQUE INDEX "index_active_storage_attachments_uniqueness" ON "active_storage_attachments" ("record_type", "record_id", "name", "blob_id")[0m
|
24
|
+
↳ db/migrate/20190325174835_create_active_storage_tables.active_storage.rb:16
|
25
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.7ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20190325174835"]]
|
26
|
+
↳ bin/rails:4
|
27
|
+
[1m[35m (7.6ms)[0m [1m[36mcommit transaction[0m
|
28
|
+
↳ bin/rails:4
|
29
|
+
Migrating to CreateCmorGalleriesPictureGalleries (20190325174856)
|
30
|
+
[1m[35m (0.4ms)[0m [1m[36mbegin transaction[0m
|
31
|
+
↳ bin/rails:4
|
32
|
+
[1m[35m (4.1ms)[0m [1m[35mCREATE TABLE "cmor_galleries_picture_galleries" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "published_at" datetime, "description" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
33
|
+
↳ db/migrate/20190325174856_create_cmor_galleries_picture_galleries.cmor_galleries.rb:4
|
34
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.7ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20190325174856"]]
|
35
|
+
↳ bin/rails:4
|
36
|
+
[1m[35m (27.3ms)[0m [1m[36mcommit transaction[0m
|
37
|
+
↳ bin/rails:4
|
38
|
+
Migrating to CreateCmorGalleriesPictureDetails (20190325174857)
|
39
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
40
|
+
↳ bin/rails:4
|
41
|
+
[1m[35m (0.5ms)[0m [1m[35mCREATE TABLE "cmor_galleries_picture_details" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "picture_gallery_id" integer, "asset_id" integer, "title" varchar, "description" text, "position" integer, "published_at" datetime, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
42
|
+
↳ db/migrate/20190325174857_create_cmor_galleries_picture_details.cmor_galleries.rb:4
|
43
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.6ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20190325174857"]]
|
44
|
+
↳ bin/rails:4
|
45
|
+
[1m[35m (6.5ms)[0m [1m[36mcommit transaction[0m
|
46
|
+
↳ bin/rails:4
|
47
|
+
[1m[36mActiveRecord::InternalMetadata Load (1.0ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
48
|
+
↳ bin/rails:4
|
49
|
+
[1m[35m (0.4ms)[0m [1m[36mbegin transaction[0m
|
50
|
+
↳ bin/rails:4
|
51
|
+
[1m[36mActiveRecord::InternalMetadata Create (1.3ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "environment"], ["value", "development"], ["created_at", "2019-03-25 17:48:56.609969"], ["updated_at", "2019-03-25 17:48:56.609969"]]
|
52
|
+
↳ bin/rails:4
|
53
|
+
[1m[35m (28.1ms)[0m [1m[36mcommit transaction[0m
|
54
|
+
↳ bin/rails:4
|
55
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
56
|
+
↳ bin/rails:4
|
57
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
58
|
+
↳ bin/rails:4
|
59
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ?[0m [["key", "environment"]]
|
60
|
+
↳ bin/rails:4
|
61
|
+
[1m[35m (0.0ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
62
|
+
↳ bin/rails:4
|
63
|
+
[1m[35m (0.7ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ?[0m [["key", "environment"]]
|
64
|
+
↳ bin/rails:4
|
65
|
+
[1m[35m (0.4ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
66
|
+
↳ bin/rails:4
|
67
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ?[0m [["key", "environment"]]
|
68
|
+
↳ bin/rails:4
|
69
|
+
[1m[35m (0.2ms)[0m [1m[35mDROP TABLE IF EXISTS "active_storage_attachments"[0m
|
70
|
+
↳ db/schema.rb:15
|
71
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
72
|
+
↳ db/schema.rb:15
|
73
|
+
[1m[35m (6.1ms)[0m [1m[35mCREATE TABLE "active_storage_attachments" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "record_type" varchar NOT NULL, "record_id" integer NOT NULL, "blob_id" integer NOT NULL, "created_at" datetime NOT NULL)[0m
|
74
|
+
↳ db/schema.rb:15
|
75
|
+
[1m[35m (4.6ms)[0m [1m[35mCREATE INDEX "index_active_storage_attachments_on_blob_id" ON "active_storage_attachments" ("blob_id")[0m
|
76
|
+
↳ db/schema.rb:15
|
77
|
+
[1m[35m (5.7ms)[0m [1m[35mCREATE UNIQUE INDEX "index_active_storage_attachments_uniqueness" ON "active_storage_attachments" ("record_type", "record_id", "name", "blob_id")[0m
|
78
|
+
↳ db/schema.rb:15
|
79
|
+
[1m[35m (0.3ms)[0m [1m[35mDROP TABLE IF EXISTS "active_storage_blobs"[0m
|
80
|
+
↳ db/schema.rb:25
|
81
|
+
[1m[35m (5.7ms)[0m [1m[35mCREATE TABLE "active_storage_blobs" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar NOT NULL, "filename" varchar NOT NULL, "content_type" varchar, "metadata" text, "byte_size" bigint NOT NULL, "checksum" varchar NOT NULL, "created_at" datetime NOT NULL)[0m
|
82
|
+
↳ db/schema.rb:25
|
83
|
+
[1m[35m (5.2ms)[0m [1m[35mCREATE UNIQUE INDEX "index_active_storage_blobs_on_key" ON "active_storage_blobs" ("key")[0m
|
84
|
+
↳ db/schema.rb:25
|
85
|
+
[1m[35m (0.2ms)[0m [1m[35mDROP TABLE IF EXISTS "cmor_galleries_picture_details"[0m
|
86
|
+
↳ db/schema.rb:36
|
87
|
+
[1m[35m (4.8ms)[0m [1m[35mCREATE TABLE "cmor_galleries_picture_details" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "picture_gallery_id" integer, "asset_id" integer, "title" varchar, "description" text, "position" integer, "published_at" datetime, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
88
|
+
↳ db/schema.rb:36
|
89
|
+
[1m[35m (0.2ms)[0m [1m[35mDROP TABLE IF EXISTS "cmor_galleries_picture_galleries"[0m
|
90
|
+
↳ db/schema.rb:47
|
91
|
+
[1m[35m (3.7ms)[0m [1m[35mCREATE TABLE "cmor_galleries_picture_galleries" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "published_at" datetime, "description" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
92
|
+
↳ db/schema.rb:47
|
93
|
+
[1m[35m (4.1ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)[0m
|
94
|
+
↳ db/schema.rb:13
|
95
|
+
[1m[35m (0.4ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
96
|
+
↳ db/schema.rb:13
|
97
|
+
[1m[35m (3.3ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES (20190325174857)[0m
|
98
|
+
↳ db/schema.rb:13
|
99
|
+
[1m[35m (3.5ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES
|
100
|
+
(20190325174856),
|
101
|
+
(20190325174835);
|
102
|
+
|
103
|
+
[0m
|
104
|
+
↳ db/schema.rb:13
|
105
|
+
[1m[35m (3.5ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
106
|
+
↳ db/schema.rb:13
|
107
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
108
|
+
↳ db/schema.rb:13
|
109
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
110
|
+
↳ db/schema.rb:13
|
111
|
+
[1m[36mActiveRecord::InternalMetadata Create (0.3ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "environment"], ["value", "development"], ["created_at", "2019-03-25 17:48:56.802055"], ["updated_at", "2019-03-25 17:48:56.802055"]]
|
112
|
+
↳ db/schema.rb:13
|
113
|
+
[1m[35m (3.7ms)[0m [1m[36mcommit transaction[0m
|
114
|
+
↳ db/schema.rb:13
|
115
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.1ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
116
|
+
↳ bin/rails:4
|
117
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
118
|
+
↳ bin/rails:4
|
119
|
+
[1m[36mActiveRecord::InternalMetadata Update (0.4ms)[0m [1m[33mUPDATE "ar_internal_metadata" SET "value" = ?, "updated_at" = ? WHERE "ar_internal_metadata"."key" = ?[0m [["value", "test"], ["updated_at", "2019-03-25 17:48:56.813329"], ["key", "environment"]]
|
120
|
+
↳ bin/rails:4
|
121
|
+
[1m[35m (5.0ms)[0m [1m[36mcommit transaction[0m
|
122
|
+
↳ bin/rails:4
|
@@ -0,0 +1,143 @@
|
|
1
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
2
|
+
[1m[36mCmor::Galleries::PictureGallery Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "cmor_galleries_picture_galleries" WHERE "cmor_galleries_picture_galleries"."name" IS NULL LIMIT ?[0m [["LIMIT", 1]]
|
3
|
+
[1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
|
4
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5
|
+
[1m[36mCmor::Galleries::PictureGallery Load (0.4ms)[0m [1m[34mSELECT "cmor_galleries_picture_galleries".* FROM "cmor_galleries_picture_galleries" ORDER BY "cmor_galleries_picture_galleries"."id" ASC LIMIT ?[0m [["LIMIT", 1]]
|
6
|
+
[1m[35m (0.4ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
7
|
+
[1m[36mCmor::Galleries::PictureGallery Create (2.4ms)[0m [1m[32mINSERT INTO "cmor_galleries_picture_galleries" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", "2019-03-25 17:49:04.551608"], ["updated_at", "2019-03-25 17:49:04.551608"]]
|
8
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
9
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
10
|
+
[1m[36mCmor::Galleries::PictureGallery Update (2.5ms)[0m [1m[33mUPDATE "cmor_galleries_picture_galleries" SET "name" = ?, "updated_at" = ? WHERE "cmor_galleries_picture_galleries"."id" = ?[0m [["name", "dummy value"], ["updated_at", "2019-03-25 17:49:04.560762"], ["id", 1]]
|
11
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
12
|
+
[1m[36mCmor::Galleries::PictureGallery Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "cmor_galleries_picture_galleries" WHERE "cmor_galleries_picture_galleries"."name" = ? LIMIT ?[0m [["name", "dummy value"], ["LIMIT", 1]]
|
13
|
+
[1m[36mCmor::Galleries::PictureGallery Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "cmor_galleries_picture_galleries" WHERE "cmor_galleries_picture_galleries"."name" = ? LIMIT ?[0m [["name", "DUMMY VALUE"], ["LIMIT", 1]]
|
14
|
+
[1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
|
15
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
16
|
+
[1m[35m (0.3ms)[0m [1m[31mrollback transaction[0m
|
17
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
18
|
+
[1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
|
19
|
+
[1m[35m (0.4ms)[0m [1m[36mbegin transaction[0m
|
20
|
+
[1m[36mCmor::Galleries::PictureGallery Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "cmor_galleries_picture_galleries" WHERE "cmor_galleries_picture_galleries"."name" = ? LIMIT ?[0m [["name", "Picture Gallery #1"], ["LIMIT", 1]]
|
21
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
22
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
23
|
+
[1m[36mCmor::Galleries::PictureGallery Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "cmor_galleries_picture_galleries" WHERE "cmor_galleries_picture_galleries"."name" IS NULL LIMIT ?[0m [["LIMIT", 1]]
|
24
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
25
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
26
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
27
|
+
[1m[36mCmor::Galleries::PictureGallery Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "cmor_galleries_picture_galleries" WHERE "cmor_galleries_picture_galleries"."name" = ? LIMIT ?[0m [["name", "Picture Gallery #2"], ["LIMIT", 1]]
|
28
|
+
[1m[36mCmor::Galleries::PictureGallery Create (0.2ms)[0m [1m[32mINSERT INTO "cmor_galleries_picture_galleries" ("name", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["name", "Picture Gallery #2"], ["created_at", "2019-03-25 17:49:04.685635"], ["updated_at", "2019-03-25 17:49:04.685635"]]
|
29
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
30
|
+
[1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
|
31
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
32
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
33
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
34
|
+
[1m[35m (0.3ms)[0m [1m[31mrollback transaction[0m
|
35
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
36
|
+
[36m Disk Storage (1.6ms) [0m[32mUploaded file to key: HpaXaXSTTBQhyk9pwjiXNpvs (checksum: PQckBuk+cVT3lBy73cnuAQ==)[0m
|
37
|
+
[1m[35m (0.4ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
38
|
+
[1m[36mActiveStorage::Blob Create (0.9ms)[0m [1m[32mINSERT INTO "active_storage_blobs" ("key", "filename", "content_type", "metadata", "byte_size", "checksum", "created_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["key", "HpaXaXSTTBQhyk9pwjiXNpvs"], ["filename", "example.png"], ["content_type", "image/png"], ["metadata", "{\"identified\":true}"], ["byte_size", 9691], ["checksum", "PQckBuk+cVT3lBy73cnuAQ=="], ["created_at", "2019-03-25 17:49:04.887434"]]
|
39
|
+
[1m[35m (0.4ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
40
|
+
[1m[35m (0.4ms)[0m [1m[31mrollback transaction[0m
|
41
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
42
|
+
[1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
|
43
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
44
|
+
[36m Disk Storage (5.9ms) [0m[32mUploaded file to key: B8o7CDJi1ubYmEcP3ZAGkEiM (checksum: PQckBuk+cVT3lBy73cnuAQ==)[0m
|
45
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
46
|
+
[1m[36mActiveStorage::Blob Create (0.5ms)[0m [1m[32mINSERT INTO "active_storage_blobs" ("key", "filename", "content_type", "metadata", "byte_size", "checksum", "created_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["key", "B8o7CDJi1ubYmEcP3ZAGkEiM"], ["filename", "example.png"], ["content_type", "image/png"], ["metadata", "{\"identified\":true}"], ["byte_size", 9691], ["checksum", "PQckBuk+cVT3lBy73cnuAQ=="], ["created_at", "2019-03-25 17:49:05.023546"]]
|
47
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
48
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
49
|
+
[1m[36mCmor::Galleries::PictureGallery Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "cmor_galleries_picture_galleries" WHERE "cmor_galleries_picture_galleries"."name" = ? LIMIT ?[0m [["name", "Picture Gallery #4"], ["LIMIT", 1]]
|
50
|
+
[1m[36mCmor::Galleries::PictureGallery Create (0.4ms)[0m [1m[32mINSERT INTO "cmor_galleries_picture_galleries" ("name", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["name", "Picture Gallery #4"], ["created_at", "2019-03-25 17:49:05.037260"], ["updated_at", "2019-03-25 17:49:05.037260"]]
|
51
|
+
[1m[36mActiveStorage::Attachment Create (0.4ms)[0m [1m[32mINSERT INTO "active_storage_attachments" ("name", "record_type", "record_id", "blob_id", "created_at") VALUES (?, ?, ?, ?, ?)[0m [["name", "assets"], ["record_type", "Cmor::Galleries::PictureGallery"], ["record_id", 1], ["blob_id", 1], ["created_at", "2019-03-25 17:49:05.040357"]]
|
52
|
+
[1m[36mCmor::Galleries::PictureDetail Load (0.4ms)[0m [1m[34mSELECT "cmor_galleries_picture_details".* FROM "cmor_galleries_picture_details" WHERE "cmor_galleries_picture_details"."picture_gallery_id" = ? AND ("cmor_galleries_picture_details"."position" IS NOT NULL) ORDER BY "cmor_galleries_picture_details"."position" DESC LIMIT ?[0m [["picture_gallery_id", 1], ["LIMIT", 1]]
|
53
|
+
[1m[36mCmor::Galleries::PictureDetail Create (0.3ms)[0m [1m[32mINSERT INTO "cmor_galleries_picture_details" ("picture_gallery_id", "asset_id", "position", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["picture_gallery_id", 1], ["asset_id", 1], ["position", 1], ["created_at", "2019-03-25 17:49:05.042893"], ["updated_at", "2019-03-25 17:49:05.042893"]]
|
54
|
+
[1m[36mCmor::Galleries::PictureDetail Load (0.3ms)[0m [1m[34mSELECT "cmor_galleries_picture_details".* FROM "cmor_galleries_picture_details" WHERE "cmor_galleries_picture_details"."picture_gallery_id" = ? AND ("cmor_galleries_picture_details"."position" IS NOT NULL) ORDER BY "cmor_galleries_picture_details"."position" DESC LIMIT ?[0m [["picture_gallery_id", 1], ["LIMIT", 1]]
|
55
|
+
[1m[36mCmor::Galleries::PictureDetail Create (0.2ms)[0m [1m[32mINSERT INTO "cmor_galleries_picture_details" ("picture_gallery_id", "asset_id", "position", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["picture_gallery_id", 1], ["asset_id", 1], ["position", 2], ["created_at", "2019-03-25 17:49:05.047593"], ["updated_at", "2019-03-25 17:49:05.047593"]]
|
56
|
+
[1m[36mCmor::Galleries::PictureGallery Update (0.5ms)[0m [1m[33mUPDATE "cmor_galleries_picture_galleries" SET "updated_at" = ? WHERE "cmor_galleries_picture_galleries"."id" = ?[0m [["updated_at", "2019-03-25 17:49:05.042145"], ["id", 1]]
|
57
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
58
|
+
[ActiveJob] Enqueued ActiveStorage::AnalyzeJob (Job ID: b25c28ce-e846-4096-a69f-b5cf4645b758) to Async(default) with arguments: #<GlobalID:0x0000000007a31d10 @uri=#<URI::GID gid://dummy/ActiveStorage::Blob/1>>
|
59
|
+
[1m[36mActiveStorage::Blob Load (1.5ms)[0m [1m[34mSELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
60
|
+
[1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
|
61
|
+
[ActiveJob] [ActiveStorage::AnalyzeJob] [b25c28ce-e846-4096-a69f-b5cf4645b758] Performing ActiveStorage::AnalyzeJob (Job ID: b25c28ce-e846-4096-a69f-b5cf4645b758) from Async(default) with arguments: #<GlobalID:0x0000000007974800 @uri=#<URI::GID gid://dummy/ActiveStorage::Blob/1>>
|
62
|
+
[ActiveJob] [ActiveStorage::AnalyzeJob] [b25c28ce-e846-4096-a69f-b5cf4645b758] [36m Disk Storage (1.8ms) [0m[34mDownloaded file from key: B8o7CDJi1ubYmEcP3ZAGkEiM[0m
|
63
|
+
[ActiveJob] [ActiveStorage::AnalyzeJob] [b25c28ce-e846-4096-a69f-b5cf4645b758] Skipping image analysis because the mini_magick gem isn't installed
|
64
|
+
[ActiveJob] [ActiveStorage::AnalyzeJob] [b25c28ce-e846-4096-a69f-b5cf4645b758] [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
65
|
+
[ActiveJob] [ActiveStorage::AnalyzeJob] [b25c28ce-e846-4096-a69f-b5cf4645b758] [1m[36mActiveStorage::Blob Update (0.3ms)[0m [1m[33mUPDATE "active_storage_blobs" SET "metadata" = ? WHERE "active_storage_blobs"."id" = ?[0m [["metadata", "{\"identified\":true,\"analyzed\":true}"], ["id", 1]]
|
66
|
+
[ActiveJob] [ActiveStorage::AnalyzeJob] [b25c28ce-e846-4096-a69f-b5cf4645b758] [1m[35m (0.2ms)[0m [1m[36mcommit transaction[0m
|
67
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
68
|
+
[ActiveJob] [ActiveStorage::AnalyzeJob] [b25c28ce-e846-4096-a69f-b5cf4645b758] Performed ActiveStorage::AnalyzeJob (Job ID: b25c28ce-e846-4096-a69f-b5cf4645b758) from Async(default) in 21.62ms
|
69
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
70
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
71
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
72
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
73
|
+
[1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
|
74
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
75
|
+
[1m[35m (0.3ms)[0m [1m[31mrollback transaction[0m
|
76
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
77
|
+
[1m[35m (0.3ms)[0m [1m[31mrollback transaction[0m
|
78
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
79
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
80
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
81
|
+
[1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
|
82
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
83
|
+
[1m[35m (0.3ms)[0m [1m[31mrollback transaction[0m
|
84
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
85
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
86
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
87
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
88
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
89
|
+
[1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
|
90
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
91
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
92
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
93
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
94
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
95
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
96
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
97
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
98
|
+
[1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
|
99
|
+
[1m[35m (0.3ms)[0m [1m[31mrollback transaction[0m
|
100
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
101
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
102
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
103
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
104
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
105
|
+
[1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
|
106
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
107
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
108
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
109
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
110
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
111
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
112
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
113
|
+
[1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
|
114
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
115
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
116
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
117
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
118
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
119
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
120
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
121
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
122
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
123
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
124
|
+
[1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
|
125
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
126
|
+
[1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
|
127
|
+
[1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
|
128
|
+
[1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
|
129
|
+
[1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
|
130
|
+
[1m[35m (1.0ms)[0m [1m[36mbegin transaction[0m
|
131
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
132
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
133
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
134
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
135
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
136
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
137
|
+
[1m[35m (0.4ms)[0m [1m[31mrollback transaction[0m
|
138
|
+
[1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
|
139
|
+
[1m[35m (0.3ms)[0m [1m[31mrollback transaction[0m
|
140
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
141
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
142
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
143
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
@@ -0,0 +1 @@
|
|
1
|
+
9d095a3642a6de2d80c204a909a899b8f3565e2c5b8b9789382e7b52e111c0e87fd813722a9b6d6fa0a2f7039ddc6d899236548a213c86e8653f11d1a1ba6c67
|
Binary file
|
Binary file
|
@@ -0,0 +1,17 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :cmor_galleries_picture_detail, class: 'Cmor::Galleries::PictureDetail' do
|
3
|
+
association :picture_gallery, factory: :cmor_galleries_picture_gallery
|
4
|
+
after(:build) { |resource|
|
5
|
+
assets = resource.picture_gallery.assets.attach(
|
6
|
+
io: File.open(File.join(Cmor::Galleries::Engine.root.join(*%w( spec files cmor galleries picture_details example.png)))),
|
7
|
+
filename: 'example.png',
|
8
|
+
content_type: 'image/png'
|
9
|
+
)
|
10
|
+
if Rails.version < "6.0.0"
|
11
|
+
resource.asset = assets.first
|
12
|
+
else
|
13
|
+
resource.asset = resource.picture_gallery.assets.first
|
14
|
+
end
|
15
|
+
}
|
16
|
+
end
|
17
|
+
end
|
Binary file
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe 'ActiveRecord::Base models', type: :model do
|
4
|
+
DEFAULT_SPECS_TO_RUN = [
|
5
|
+
:is_an_active_record,
|
6
|
+
:is_instanciable,
|
7
|
+
:valid_with_correct_attributes,
|
8
|
+
:not_valid_with_empty_attributes,
|
9
|
+
:saves_with_valid_attributes
|
10
|
+
]
|
11
|
+
|
12
|
+
{
|
13
|
+
Cmor::Galleries::PictureGallery => {},
|
14
|
+
Cmor::Galleries::PictureDetail => {},
|
15
|
+
}.each do |model, options|
|
16
|
+
options.reverse_merge!(specs_to_run: DEFAULT_SPECS_TO_RUN, specs_to_skip: [])
|
17
|
+
specs_to_run = options.delete(:specs_to_run)
|
18
|
+
specs_to_skip = options.delete(:specs_to_skip)
|
19
|
+
specs = specs_to_run - specs_to_skip
|
20
|
+
|
21
|
+
describe model do
|
22
|
+
it 'is an ActiveRecord::Base' do
|
23
|
+
expect(ActiveRecord::Base.descendants).to include(model)
|
24
|
+
end if specs.include?(:is_an_active_record)
|
25
|
+
|
26
|
+
it 'is instanciable' do
|
27
|
+
instance = model.new
|
28
|
+
expect(instance).to be_a(model)
|
29
|
+
end if specs.include?(:is_instanciable)
|
30
|
+
|
31
|
+
it 'is valid with correct attribute values' do
|
32
|
+
instance = build(model.to_s.tableize.singularize.underscore.tr('/', '_'))
|
33
|
+
|
34
|
+
instance.valid?
|
35
|
+
expect(instance.errors.full_messages).to eq([])
|
36
|
+
end if specs.include?(:valid_with_correct_attributes)
|
37
|
+
|
38
|
+
it 'is not valid with empty attributes' do
|
39
|
+
instance = model.new
|
40
|
+
expect(instance).not_to be_valid
|
41
|
+
end if specs.include?(:not_valid_with_empty_attributes)
|
42
|
+
|
43
|
+
it 'saves with valid attributes' do
|
44
|
+
instance = build(model.to_s.tableize.singularize.underscore.tr('/', '_'))
|
45
|
+
expect(instance.save).to be_truthy
|
46
|
+
expect(instance).to be_persisted
|
47
|
+
end if specs.include?(:saves_with_valid_attributes)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe 'Translations', type: :model do
|
4
|
+
{
|
5
|
+
Cmor::Galleries::PictureGallery => {},
|
6
|
+
Cmor::Galleries::PictureDetail => {},
|
7
|
+
}.each do |model, options|
|
8
|
+
I18n.available_locales.each do |locale|
|
9
|
+
I18n.locale = locale
|
10
|
+
|
11
|
+
describe "for locale #{locale}:" do
|
12
|
+
describe "#{model} translations" do
|
13
|
+
it 'include one' do
|
14
|
+
I18n.locale = locale
|
15
|
+
i18n_key = ['activerecord', 'models', model.name.underscore].join('.')
|
16
|
+
i18n_options = {}
|
17
|
+
expect(I18n.translate!(i18n_key, options)[:one]).to be_a(String)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'include other' do
|
21
|
+
I18n.locale = locale
|
22
|
+
i18n_key = ['activerecord', 'models', model.name.underscore].join('.')
|
23
|
+
i18n_options = {}
|
24
|
+
expect(I18n.translate!(i18n_key, options)[:other]).to be_a(String)
|
25
|
+
end
|
26
|
+
|
27
|
+
describe 'for attributes' do
|
28
|
+
|
29
|
+
model.column_names.each do |column_name|
|
30
|
+
it "include #{column_name}" do
|
31
|
+
I18n.locale = locale
|
32
|
+
i18n_key = ['activerecord', 'attributes', model.name.underscore, column_name].join('.')
|
33
|
+
expect(I18n.translate!(i18n_key)).to be_a(String)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|