richer_text 0.6.0 → 0.7.0

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: 823a38cf937e83676b16a06828bf3a3fa461f8b3d38ae628beecd33dfc3927c2
4
- data.tar.gz: 4f02bdb13f66fb9b896dee5d52a01806dfab1cf842c4aa33250d1420b49c8fad
3
+ metadata.gz: 5b81c08a89947035259c743a2fafd9733cc908c9ad44b79d10fe628c8b623f28
4
+ data.tar.gz: 96b812bf2680e6fef1b889078a8b4641385dbef977604d43df39e38c5fc009a4
5
5
  SHA512:
6
- metadata.gz: 1cf13ee1015adee390ccdb1da3a3f2f317f01c70ea2f10364762c526a1619f56aa79085ddae04ab1690ed602bca0ccdedc3f83c0691fca21c9d4f46cc4314ade
7
- data.tar.gz: 9f1fffb59f348833c3a7ebdf1b86075bddfb2a4b4b4459bb7bdb211418e6fbf34c2ffe42c3b9c70f9c2610f6bd2874386003a11a0aaa75adbc64cc55149f6aa6
6
+ metadata.gz: 119fa92b171048de0cb69a215a11fca49ae736e4a9e473e412344d81b035739cb65f0d534ecef6e00d4fe38fdb59ddff6cf5e42d66d534afd5c6a94891f8d6e6
7
+ data.tar.gz: f6f03e6c4b2693c60f5f16adf47edc301b66f63ae4a881da39ed8a5500fec0dfbbf0531f173d52813b17521ce2b487fc48ccf0555694480be02c8c0edee409a8
@@ -3,10 +3,10 @@ module RicherText
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  class_methods do
6
- def has_richer_text(name, json: false)
6
+ def has_richer_text(name, store_as: :html)
7
7
  # Store if the attribute is using JSON or not.
8
8
  class_attribute :"richer_text_#{name}_json", instance_writer: false
9
- self.send(:"richer_text_#{name}_json=", json)
9
+ self.send(:"richer_text_#{name}_json=", store_as == :json)
10
10
 
11
11
  class_eval <<-CODE, __FILE__, __LINE__ + 1
12
12
  def #{name}
@@ -23,7 +23,7 @@ module RicherText
23
23
  CODE
24
24
 
25
25
  has_one :"richer_text_#{name}", -> { where(name: name) },
26
- class_name: json ? "RicherText::JsonText" : "RicherText::RichText", as: :record, inverse_of: :record, autosave: true, dependent: :destroy
26
+ class_name: store_as == :json ? "RicherText::JsonText" : "RicherText::RichText", as: :record, inverse_of: :record, autosave: true, dependent: :destroy
27
27
 
28
28
  scope :"with_richer_text_#{name}", -> { includes("richer_text_#{name}") }
29
29
  end
@@ -1,3 +1,3 @@
1
1
  module RicherText
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: richer_text
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Fomera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-18 00:00:00.000000000 Z
11
+ date: 2023-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails