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 +4 -4
- data/lib/richer_text/attribute.rb +3 -3
- data/lib/richer_text/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b81c08a89947035259c743a2fafd9733cc908c9ad44b79d10fe628c8b623f28
|
4
|
+
data.tar.gz: 96b812bf2680e6fef1b889078a8b4641385dbef977604d43df39e38c5fc009a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
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
|
data/lib/richer_text/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2023-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|