ksk 0.2.14 → 0.2.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/ksk/asset.rb +4 -12
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed81b7b99a4deb66356de2adc6c8f036655477d8
|
4
|
+
data.tar.gz: 35360c3933051318c9a73f098d074bc0856db754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91179ee7965f4870e388478e7325ccad75f275f1d6d8bc43310a22640fb7f411a6a7b00f96f384c440bea181247bce690664b24d83445c0eb7764bf0d8c56b7e
|
7
|
+
data.tar.gz: 7894a25d602a3790ce6a3683349849044a6159793a0e964a0de4abfb40120b136b27f587a4b506f41d042a816f95d348a60b7c69541c042ef97b62a0f99368df
|
@@ -12,17 +12,16 @@ module Ksk::Asset
|
|
12
12
|
after_initialize :resize_attr_accessors
|
13
13
|
before_save :crop_thumbs, if: :cropping?
|
14
14
|
|
15
|
-
IMGTYPE = ['image/jpeg', 'image/pjpeg', 'image/jpg', 'image/png', 'image/tif', 'image/gif']
|
16
15
|
do_not_validate_attachment_file_type :file
|
17
16
|
|
18
|
-
scope :only_images, -> {where(file_content_type:
|
17
|
+
scope :only_images, -> {where(file_content_type: Bhf::PAPERCLIP_IMAGE_TYPES)}
|
19
18
|
scope :first_image, -> {only_images.limit(1)}
|
20
19
|
scope :other_images, -> {only_images.offset(1)}
|
21
20
|
|
22
|
-
scope :only_data_files, -> {where('file_content_type not in (?)',
|
21
|
+
scope :only_data_files, -> {where('file_content_type not in (?)', Bhf::PAPERCLIP_IMAGE_TYPES)}
|
23
22
|
scope :first_data_files, -> {only_data_files.limit(1)}
|
24
23
|
|
25
|
-
before_file_post_process :
|
24
|
+
before_file_post_process :is_image?
|
26
25
|
end
|
27
26
|
|
28
27
|
def resize_attr_accessors
|
@@ -66,15 +65,8 @@ module Ksk::Asset
|
|
66
65
|
file.queued_for_write[name] = Paperclip.io_adapters.for(file.queued_for_write[name])
|
67
66
|
end
|
68
67
|
|
69
|
-
|
70
|
-
def allow_only_images
|
71
|
-
if !(file.content_type =~ %r{^(image|(x-)?application)/(x-png|pjpeg|jpeg|jpg|png|gif)$})
|
72
|
-
return false
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
68
|
def is_image?
|
77
|
-
|
69
|
+
Bhf::PAPERCLIP_IMAGE_TYPES.include?(file.content_type)
|
78
70
|
end
|
79
71
|
|
80
72
|
def has_preview?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ksk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Pawlik
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.7.
|
19
|
+
version: 0.7.16
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.7.
|
26
|
+
version: 0.7.16
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: stringex
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|