promethee 1.6.1 → 1.6.2

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
  SHA1:
3
- metadata.gz: b05cc8c6b7258f424d9e44b4d7e3e667ee3eecef
4
- data.tar.gz: a7c476562765d36ee451d5fce58476e2afd178a2
3
+ metadata.gz: a5f754567c4af7441755181e8f6e6a13b4ea1c22
4
+ data.tar.gz: 2056bc3a56887d62edab46d2c0661452f7b9e99d
5
5
  SHA512:
6
- metadata.gz: 805ce80707522a75e4050398aa95ff4bf86bb6b0b1050f759bcfda15616f828880b4ef26a0fb43ed4f490592a3e3ceb776d8429f5119358c0ed1adfb65f4237d
7
- data.tar.gz: c75fa0ef648d6fc07cf09cc3ba61cb1cee3a29e3f225fad19d6e4b93c354263e01c4a29f5bd6ec0e4fa56cf239d6efc1b3c0e7467cca152c4968ddb23c39b53e
6
+ metadata.gz: 346e777eddfa53be7e94cbcec9ff95d8b71f01fc8f5502abffd5508be8bf098e4aaa390e883e82fcf8e4acd370445b22337b11802720b529d2d639750e278201
7
+ data.tar.gz: e963a757b0373109dbbbb0cfa522ae24947c9b8e402f54e659611675f480bada630c0df3c50378c39c06919b5aa7b054c575ba4e060ae322ad7c8177c2c9a30f
data/README.md CHANGED
@@ -361,6 +361,13 @@ In the controllers, don't forget to change the params to convert the data from j
361
361
  end
362
362
  ```
363
363
 
364
+ If you want to store true Json (and not a string) in the "data" attribute of the model just include the concern PrometheeData
365
+ ```
366
+ class Page < ApplicationRecord
367
+ include PrometheeData
368
+ end
369
+ `a `
370
+
364
371
  ### SQLite (or other not native json storage)
365
372
 
366
373
  Prométhée takes a ruby hash.
@@ -0,0 +1,8 @@
1
+ module PrometheeData
2
+ extend ActiveSupport::Concern
3
+
4
+ def data=(value)
5
+ value = JSON.parse value if value.is_a? String
6
+ super(value)
7
+ end
8
+ end
@@ -1,5 +1,5 @@
1
1
  module Promethee
2
2
  module Rails
3
- VERSION = '1.6.1'
3
+ VERSION = '1.6.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promethee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Dargelos
@@ -180,6 +180,7 @@ files:
180
180
  - app/assets/stylesheets/promethee-edit/_preview.sass
181
181
  - app/assets/stylesheets/promethee.sass
182
182
  - app/controllers/promethee_controller.rb
183
+ - app/models/concerns/promethee_data.rb
183
184
  - app/views/promethee/_edit.html.erb
184
185
  - app/views/promethee/_localize.html.erb
185
186
  - app/views/promethee/_show.html.erb