effective_assets 1.12.0 → 1.12.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f65f48554e7a828db12f7dee36c5b88664d05d62e9cef510ce45bbd63087d01c
|
4
|
+
data.tar.gz: 110be6a9d526d749485332af287a9ed78b392dc48f0f4790f8d90764e91b7530
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '019b6aa40e1af5d85d48eea6b80b0d7a89c981412099a500908235233cfec771f11c3447f69979555a78c90f4ba808ddaf863875fdf8eb0869608dda0881dea7'
|
7
|
+
data.tar.gz: eb176c764207dca6bb761df0a08bfb3bdfd945cc493284273e6db43adc5df3410ba5826359c560133eb775816151b7113295ec2f3fa79ecd0cd4588a4661e495
|
@@ -8,14 +8,18 @@ module EffectiveAssets
|
|
8
8
|
|
9
9
|
# Include acts_as_addressable concern and allow any ActiveRecord object to call it
|
10
10
|
initializer 'effective_assets.active_record' do |app|
|
11
|
-
|
12
|
-
|
11
|
+
app.config.to_prepare do
|
12
|
+
ActiveSupport.on_load :active_record do
|
13
|
+
ActiveRecord::Base.extend(ActsAsAssetBox::ActiveRecord)
|
14
|
+
end
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
16
18
|
initializer 'effective_assets.action_view' do |app|
|
17
|
-
|
18
|
-
|
19
|
+
app.config.to_prepare do
|
20
|
+
ActiveSupport.on_load :action_view do
|
21
|
+
ActionView::Helpers::FormBuilder.send(:include, AssetBoxFormInput)
|
22
|
+
end
|
19
23
|
end
|
20
24
|
end
|
21
25
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -176,7 +176,6 @@ files:
|
|
176
176
|
- app/models/effective/attachment.rb
|
177
177
|
- app/models/effective/iframe_upload.rb
|
178
178
|
- app/models/effective/snippet_replacer.rb
|
179
|
-
- app/models/effective/snippets/effective_asset.rb
|
180
179
|
- app/uploaders/effective_assets_uploader.rb
|
181
180
|
- app/uploaders/test_asset_uploader.rb
|
182
181
|
- app/views/active_admin/effective_assets/_edit.html.haml
|
@@ -1,37 +0,0 @@
|
|
1
|
-
if defined?(EffectiveRegions)
|
2
|
-
module Effective
|
3
|
-
module Snippets
|
4
|
-
class EffectiveAsset < Snippet
|
5
|
-
# attr_accessor :asset_id #, Integer
|
6
|
-
# attr_accessor :html_class #, String
|
7
|
-
# attr_accessor :link_title #, String
|
8
|
-
# attr_accessor :private_url # , Boolean
|
9
|
-
|
10
|
-
def snippet_attributes
|
11
|
-
super + [:asset_id, :html_class, :link_title, :private_url]
|
12
|
-
end
|
13
|
-
|
14
|
-
def asset
|
15
|
-
@asset ||= (Effective::Asset.where(:id => asset_id).first if asset_id)
|
16
|
-
end
|
17
|
-
|
18
|
-
def snippet_tag
|
19
|
-
:span
|
20
|
-
end
|
21
|
-
|
22
|
-
def private_url
|
23
|
-
super || aws_private?
|
24
|
-
end
|
25
|
-
|
26
|
-
def is_private?
|
27
|
-
[true, 'true', '1'].include?(private_url)
|
28
|
-
end
|
29
|
-
|
30
|
-
def aws_private?
|
31
|
-
(asset.try(:aws_acl) == EffectiveAssets::AWS_PRIVATE)
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|