richer_text 0.19.0 → 0.20.0

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: 5c1451c3d247fb8219bdf6864f676f238100b739004d4aaf39647c69252bcbd7
4
- data.tar.gz: 8d739523b17f1d38d8d6532db0842a6dadad661175d22382bdb20a6112929f62
3
+ metadata.gz: 678e1169424b3442c3a1930a2ab34e4e7ec724e2a2e8381bfdd7f8b789bb1eff
4
+ data.tar.gz: 5dfd1574889342d9308fbbe79c5959bdc86eb816ae8d82f466ed6140f8ab3dc1
5
5
  SHA512:
6
- metadata.gz: 2484cd219fe49d7c0cda66fb6077789acf46b18ac366ba2b5fdb0133a98790db9e1dd8a58854ff484562a6efa48650fa5ad996add75b3ca2be87d54c46648c5a
7
- data.tar.gz: 9869c6ada748a2b5d49573c7e40a3e2efa1bd093eb3386a3dae90475343707e21c7e9303d2c197d582e006d8586505084241d8c2f5f1f81198d7d6325528ed07
6
+ metadata.gz: 59ca2d890918fb81e3d4ee4619c2ce1c5e41ea97736f90cf0bec50ab2eb10a2e007cdd2a466e5bdfe8ad0bb522252fa00165984bc8fcc729489eededf47c884d
7
+ data.tar.gz: 7fcb45cebc874bbe5437a695688677d6d4eb90493e18021b46e776453c105722946e14aa0845f33bd050bf1cfed64ca67063dd381044924d0c4b71b6d8552306
@@ -12,6 +12,7 @@ module ActionView::Helpers
12
12
  options["input"] ||= dom_id(object, [options["id"], :richer_text_input].compact.join("_")) if object
13
13
  options["value"] = options.fetch("value") { value&.to_editor_format }
14
14
  options["serializer"] = options.fetch("serializer") { object.class.send(:"richer_text_#{@method_name}_json") ? "json" : "html" }
15
+ options["attachments"] = options.fetch("attachments") { object.class.send(:"richer_text_#{@method_name}_allow_attachments") }
15
16
 
16
17
  @template_object.richer_text_area_tag(options.delete("name"), options["value"], options.except("value"))
17
18
  end
@@ -3,11 +3,15 @@ module RicherText
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  class_methods do
6
- def has_richer_text(name, store_as: :html)
6
+ def has_richer_text(name, store_as: :html, attachments: true)
7
7
  # Store if the attribute is using JSON or not.
8
8
  class_attribute :"richer_text_#{name}_json", instance_writer: false
9
9
  self.send(:"richer_text_#{name}_json=", store_as == :json)
10
10
 
11
+ # Store if the attribute allows attachments
12
+ class_attribute :"richer_text_#{name}_allow_attachments", instance_writer: false
13
+ self.send(:"richer_text_#{name}_allow_attachments=", attachments)
14
+
11
15
  class_eval <<-CODE, __FILE__, __LINE__ + 1
12
16
  def #{name}
13
17
  richer_text_#{name} || build_richer_text_#{name}
@@ -1,3 +1,3 @@
1
1
  module RicherText
2
- VERSION = "0.19.0"
2
+ VERSION = "0.20.0"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: richer_text
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Fomera
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-30 00:00:00.000000000 Z
10
+ date: 2025-02-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails