cm_page_builder-rails 0.1.4 → 0.1.6

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: cb8cb60af95314796041dcb3636d626bce3225a851dc35a03b0f7fef2683ee7f
4
- data.tar.gz: 275d1733d69c98325a37d78f2caa613539f93d2f90c5d44b54e388c6145a6727
3
+ metadata.gz: 51be7b50af0a64979c7216cd1687ae48093d76030d9cac44c3b790dff4d6d160
4
+ data.tar.gz: 1b89235b4884ae9fc9738cc5b9c4eaf39d0c32d50fd330878bb293cd6f9c2fd8
5
5
  SHA512:
6
- metadata.gz: 15cff37e33a92c85155e0f3f1a0186441963fef8a5e9e5977d3c0eade95f2f3e2add98678b0a2d10434d9af5556c0793fd5dfd513c4a0f64aacb7d0aa54a5234
7
- data.tar.gz: 0012f11661630abdddff3ec1d157ba339c934371205758b9a8ee1da31d2846688bfa6c7b0724958bc856adcb18341c5e7c090dfc406e722b24177e3ac4323f58
6
+ metadata.gz: 16aaa2ad23fbe4c0c58602a931776605431866ed86ef1db20dbb677db5e4ba55b824e66ece9e3ef199c6e1ebfeddc019ad105a763fb6508b46a30a3de9bf3d16
7
+ data.tar.gz: dafcaff557ba6f4ffb13f5cb01beda9c098e678e0d91e25dd1cdbc9282764203f747051d4289a94b6c9db695769a2d7ef00aa51b5c0a16abbef16dcecdd9a9ab
@@ -11,11 +11,18 @@ module CmPageBuilder::Rails
11
11
  attachment = component.component_attachment.attachment
12
12
  json_component["id"] = component[:uuid]
13
13
  json_component["component_attachment"] = if attachment
14
- {
14
+ component_data = {
15
15
  filename: attachment.filename.to_s,
16
- url: attachment.service_url,
17
- dimensions: attachment.blob.metadata
16
+ url: attachment.service_url
18
17
  }
18
+ dimensions = attachment.blob.metadata
19
+ dimensions["orientation"] = if dimensions["width"] > dimensions["height"]
20
+ "portrait"
21
+ else
22
+ "landscape"
23
+ end
24
+ component_data["dimensions"] = dimensions
25
+ component_data
19
26
  end
20
27
  json_component
21
28
  end
@@ -1,5 +1,5 @@
1
1
  module CmPageBuilder
2
2
  module Rails
3
- VERSION = '0.1.4'
3
+ VERSION = '0.1.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cm_page_builder-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Camilo Ernesto Forero Junco
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-03 00:00:00.000000000 Z
11
+ date: 2019-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails