cmor_system 0.0.58.pre → 0.0.59.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/cmor/system/active_storage/attachments_controller.rb +2 -0
- data/app/controllers/cmor/system/active_storage/blobs_controller.rb +2 -0
- data/config/routes.rb +6 -2
- data/lib/cmor/system/configuration.rb +1 -0
- data/lib/generators/cmor/system/install/install_generator.rb +2 -0
- data/lib/generators/cmor/system/install/templates/initializer.rb +7 -1
- data/spec/factories/active_storage/attachments.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6eb238490d287906173de5a56da0ef280d4482a8d6ed7457b485ed31fd241de
|
4
|
+
data.tar.gz: 16814da714201f4d46bc87431f572a9d80953c91e6840889b9f89461bfb5490d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 918901f26e5c9cc187362558ac5fd2e0aeabc493279bb89a4fed1ebb8191dd0e07b7b1434d88b47aac0b89c29e1a498277e497fdbf57a472aad4d35ab0fd2199
|
7
|
+
data.tar.gz: 3f16b879a662b9e02a38f36280fe8f1a2deb22735be223a01c746c35764472cba6d5f2ad0fe0620972ebb4d92068129b80dba5d87ea93b3456c3bf12d86004da
|
@@ -2,6 +2,8 @@ module Cmor
|
|
2
2
|
module System
|
3
3
|
module ActiveStorage
|
4
4
|
class AttachmentsController < Cmor::Core::Backend::ResourcesController::Base
|
5
|
+
include Cmor::Audits::ResourcesController::PaperTrailConcern if Cmor::Core.features?(:cmor_audits)
|
6
|
+
|
5
7
|
def self.engine_class
|
6
8
|
::Cmor::System::Engine
|
7
9
|
end
|
@@ -2,6 +2,8 @@ module Cmor
|
|
2
2
|
module System
|
3
3
|
module ActiveStorage
|
4
4
|
class BlobsController < Cmor::Core::Backend::ResourcesController::Base
|
5
|
+
include Cmor::Audits::ResourcesController::PaperTrailConcern if Cmor::Core.features?(:cmor_audits)
|
6
|
+
|
5
7
|
def self.engine_class
|
6
8
|
::Cmor::System::Engine
|
7
9
|
end
|
data/config/routes.rb
CHANGED
@@ -2,8 +2,12 @@ Cmor::System::Engine.routes.draw do
|
|
2
2
|
resources :changelogs, only: [:index, :show]
|
3
3
|
resources :delayed_backend_active_record_jobs if Cmor::System::Configuration.enable_delayed_job_backend
|
4
4
|
namespace :active_storage do
|
5
|
-
resources :blobs , only: [:index, :show, :destroy]
|
6
|
-
|
5
|
+
resources :blobs , only: [:index, :show, :destroy] do
|
6
|
+
Cmor::Core::Backend::Routing::ResourcesRoutes.inject_routes(self)
|
7
|
+
end
|
8
|
+
resources :attachments , only: [:index, :show, :destroy] do
|
9
|
+
Cmor::Core::Backend::Routing::ResourcesRoutes.inject_routes(self)
|
10
|
+
end
|
7
11
|
end if Cmor::System::Configuration.enable_active_storage_backend
|
8
12
|
|
9
13
|
root to: 'home#index'
|
@@ -13,6 +13,7 @@ module Cmor
|
|
13
13
|
mattr_accessor(:enable_active_storage_backend) { false }
|
14
14
|
mattr_accessor(:enable_delayed_job_backend) { false }
|
15
15
|
mattr_accessor(:record_factory_name) { 'user' }
|
16
|
+
mattr_accessor(:record_attachment_name) { 'asset' }
|
16
17
|
|
17
18
|
def self.registered_controllers
|
18
19
|
rc = @@registered_controllers.call
|
@@ -9,12 +9,14 @@ module Cmor
|
|
9
9
|
attr_reader :cmor_system_enable_active_storage
|
10
10
|
attr_reader :cmor_system_enable_delayed_job
|
11
11
|
attr_reader :record_factory_name
|
12
|
+
attr_reader :record_attachment_name
|
12
13
|
|
13
14
|
def initialize(*args)
|
14
15
|
super
|
15
16
|
@cmor_system_enable_active_storage = ENV.fetch('CMOR_SYSTEM_ENABLE_ACTIVE_STORAGE') { false }
|
16
17
|
@cmor_system_enable_delayed_job = ENV.fetch('CMOR_SYSTEM_ENABLE_DELAYED_JOB') { false }
|
17
18
|
@record_factory_name = ENV.fetch('CMOR_SYSTEM_RECORD_FACTORY_NAME') { 'post' }
|
19
|
+
@record_attachment_name = ENV.fetch('CMOR_SYSTEM_RECORD_ATTACHMENT_NAME') { 'asset' }
|
18
20
|
end
|
19
21
|
|
20
22
|
def generate_initializer
|
@@ -21,12 +21,18 @@ Cmor::System.configure do |config|
|
|
21
21
|
config.registered_services = -> {[
|
22
22
|
]}
|
23
23
|
|
24
|
-
# Factory name to use for
|
24
|
+
# Factory name to use for active storage attachment records.
|
25
25
|
#
|
26
26
|
# default: config.record_factory_name = 'post'
|
27
27
|
#
|
28
28
|
config.record_factory_name = '<%= record_factory_name %>'
|
29
29
|
|
30
|
+
# Attachment name to use for active storage attachments.
|
31
|
+
#
|
32
|
+
# default: config.record_attachment_name = 'asset'
|
33
|
+
#
|
34
|
+
config.record_attachment_name = '<%= record_attachment_name %>'
|
35
|
+
|
30
36
|
# Enable support for ActiveStorage.
|
31
37
|
#
|
32
38
|
# default: config.enable_active_storage_backend = false
|
@@ -2,6 +2,6 @@ FactoryBot.define do
|
|
2
2
|
factory :active_storage_attachment, class: 'ActiveStorage::Attachment' do
|
3
3
|
association(:record, factory: Cmor::System::Configuration.record_factory_name)
|
4
4
|
association(:blob, factory: :active_storage_blob)
|
5
|
-
name {
|
5
|
+
name { Cmor::System::Configuration.record_attachment_name }
|
6
6
|
end
|
7
7
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmor_system
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.59.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.0.
|
33
|
+
version: 0.0.59.pre
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.0.
|
40
|
+
version: 0.0.59.pre
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: cmor_core_backend
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.0.
|
47
|
+
version: 0.0.59.pre
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.0.
|
54
|
+
version: 0.0.59.pre
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: sqlite3
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|