ecm_pictures2_backend 2.0.1 → 2.0.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 700744373fc780dd88f36e9459cda0a6bf790cf2
|
4
|
+
data.tar.gz: de6d2f89b0cdee79d1bbff819beb9353a505d971
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a2086394c8917c32741b252ba0c427eeee46a7f997efba62c6de7022de2b0eb9410d873f12ea0493401837729ca1de4c03d414eec122d8fe881a2a64bdbf6ed
|
7
|
+
data.tar.gz: ae15260cd8b9e3ba0fb0afd584270fdb4f6f8692fa88f0677b60844918b1c4aa4f11e26976717cb213a4b936fbb3bf281d2125ea0d3da1da5ecff29a8a646f98
|
@@ -6,11 +6,10 @@ class Ecm::Pictures::Backend::PicturesController < Itsf::Backend::Resource::Base
|
|
6
6
|
private
|
7
7
|
|
8
8
|
def request_includes_base64_image?
|
9
|
-
params[:ecm_pictures_picture].key?(:image_base64)
|
9
|
+
params[:ecm_pictures_picture].key?(:image_base64)
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
13
|
-
encoded_image = params[:ecm_pictures_picture].delete(:image_base64)
|
12
|
+
def extract_image_base64(encoded_image)
|
14
13
|
decoded_image = Base64.decode64(encoded_image.gsub(/^data\:image\/\w+\;base64\,/, '')).force_encoding('UTF-8')
|
15
14
|
content_type = encoded_image.split(';').first.split(':').last
|
16
15
|
basename = 'image'
|
@@ -23,9 +22,13 @@ class Ecm::Pictures::Backend::PicturesController < Itsf::Backend::Resource::Base
|
|
23
22
|
end
|
24
23
|
|
25
24
|
def permitted_params
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
processed_params = params.deep_dup
|
26
|
+
image_base64 = processed_params[:ecm_pictures_picture].try(:delete, :image_base64)
|
27
|
+
if image_base64.present?
|
28
|
+
image = extract_image_base64(image_base64)
|
29
|
+
processed_params.merge!(image: extract_base64)
|
30
|
+
end
|
31
|
+
processed_params.require(:ecm_pictures_picture)
|
32
|
+
.permit(:picture_gallery_id, :name, :markup_language, :description, :image, :tag_list)
|
30
33
|
end
|
31
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecm_pictures2_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
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: 2016-02-
|
11
|
+
date: 2016-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -276,4 +276,3 @@ signing_key:
|
|
276
276
|
specification_version: 4
|
277
277
|
summary: Backend Module for ECM Pictures 2
|
278
278
|
test_files: []
|
279
|
-
has_rdoc:
|