effective_regions 1.10.1 → 1.10.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 569274e4566d124929e79f9f88656573e2d50d2d012c74b5709e5b27454edd00
|
4
|
+
data.tar.gz: 4fd9c98375899a4ea8adb0b8e8dcbb6715ac2d3cd60420b8bf1f28e6c4efad10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fdbc44857f5dda59b5a6ed6eb6fbf97a97218ce8d23dd4fda592837c27c45266a1c8cde7c2a9fdbe82d9adc9aff24d94096f286634f42b8cabf7bfa55e021c8
|
7
|
+
data.tar.gz: bcfb0669cc3725125ca54bb6d4b37717da7f6743bf2e9513c9b6dd5e407f6eed991323462d3d620e51e7564e606dfd33acb4da4a907deb4afc26ed3c3a0b32d0
|
@@ -1,37 +1,36 @@
|
|
1
|
-
|
2
|
-
module
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
# attr_accessor :private_url # , Boolean
|
1
|
+
module Effective
|
2
|
+
module Snippets
|
3
|
+
class EffectiveAsset < Snippet
|
4
|
+
# attr_accessor :asset_id #, Integer
|
5
|
+
# attr_accessor :html_class #, String
|
6
|
+
# attr_accessor :link_title #, String
|
7
|
+
# attr_accessor :private_url # , Boolean
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
def asset
|
15
|
-
@asset ||= (Effective::Asset.where(:id => asset_id).first if asset_id)
|
16
|
-
end
|
9
|
+
def snippet_attributes
|
10
|
+
super + [:asset_id, :html_class, :link_title, :private_url]
|
11
|
+
end
|
17
12
|
|
18
|
-
|
19
|
-
|
20
|
-
|
13
|
+
def asset
|
14
|
+
return nil unless defined?(Effective::Asset)
|
15
|
+
@asset ||= (Effective::Asset.where(:id => asset_id).first if asset_id)
|
16
|
+
end
|
21
17
|
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
def snippet_tag
|
19
|
+
:span
|
20
|
+
end
|
25
21
|
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
def private_url
|
23
|
+
super || aws_private?
|
24
|
+
end
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
def is_private?
|
27
|
+
[true, 'true', '1'].include?(private_url)
|
28
|
+
end
|
33
29
|
|
30
|
+
def aws_private?
|
31
|
+
asset.try(:aws_acl) == 'authenticated-read'
|
34
32
|
end
|
33
|
+
|
35
34
|
end
|
36
35
|
end
|
37
36
|
end
|
@@ -3,6 +3,7 @@ module EffectiveRegions
|
|
3
3
|
engine_name 'effective_regions'
|
4
4
|
|
5
5
|
config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
|
6
|
+
config.autoload_paths += Dir["#{config.root}/app/models/effective/snippets"]
|
6
7
|
|
7
8
|
# Include Helpers to base application
|
8
9
|
initializer 'effective_regions.action_controller' do |app|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_regions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.3
|
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:
|
11
|
+
date: 2023-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|