asbru 0.0.12 → 0.0.15

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: 392e033f6644c63cc44f180b0e6d5ad6544db1c1045a7ed6f214e58053d49e84
4
- data.tar.gz: 36579ffc30c7b237a3d4610089fe68db7b530b13e1da8e67f0ff785ed12450ab
3
+ metadata.gz: ebf12b69b01b62d6dcbc52649220873833aee8f9f9e5fa02d7ebfc568612b3ca
4
+ data.tar.gz: dfb5e1c9e02f4943c2f6e8a187c00b105756b08e64e60531a35307907618b227
5
5
  SHA512:
6
- metadata.gz: 85318b00ed09b9e5de6c81526c1d3782a6f0a9f9f6d1028d17c02a1ca0e2abe83409be931dc509abc144a7f11f4f4706dcadc1f091c6d27c12e4fcd9c3eb4d7d
7
- data.tar.gz: e5e5a20151b86106c7b021f80ad5b5a2c4f100620ae098c5f5665f6b4d324d07032e692c3f611322585762084716bb190cf74b9657ef1c699efa864a9abf46ad
6
+ metadata.gz: 36e7a3e6eb29ed8978569190fc086cafd983ced9e3669c77f8e1b4b4d3e9470f9634441bea50f8112cf37b050d9cf3054e47210dcd4ddf41a7d5ff6d4fecace1
7
+ data.tar.gz: 682f6f031a738b95d31083d27ba11669b8dfdb161697d71bd67c14c5497d132d6d32724f43039c2213a01f395edc6d2e5d4058299f459e888b4198dbf1726f87
@@ -93,13 +93,20 @@ module Asbru
93
93
  collection,
94
94
  value_method,
95
95
  text_method,
96
- _options,
96
+ options,
97
97
  multiple = false)
98
98
  collection.map do |item|
99
99
  {
100
- label: item.send(text_method),
100
+ label: if options[:translate_options]
101
+ I18n.t(
102
+ item.send(text_method),
103
+ scope: "activerecord.attributes.#{@object.class.name.downcase}.#{attribute}_options"
104
+ )
105
+ else
106
+ item.send(text_method)
107
+ end,
101
108
  value: item.send(value_method),
102
- name: tag_name_for(attribute, multiple),
109
+ name: options[:name] || tag_name_for(attribute, multiple),
103
110
  checked: if @object.nil?
104
111
  false
105
112
  else
@@ -164,8 +171,10 @@ module Asbru
164
171
  errors: errors(attribute),
165
172
  errorIcon: error_icon,
166
173
  type: 'file',
174
+ attachmentDeletionKey: tag_name_for("_delete_#{attribute}"),
167
175
  **options
168
176
  }
177
+
169
178
  if @object.present? && attribute.present?
170
179
  options[:label] ||= I18n.t(attribute,
171
180
  scope: "activerecord.attributes.#{@object.class.name.downcase}")
data/lib/asbru/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Asbru
2
- VERSION = '0.0.12'
2
+ VERSION = '0.0.15'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asbru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stev-0
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-01 00:00:00.000000000 Z
11
+ date: 2022-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.2.15
111
+ rubygems_version: 3.3.7
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Asbru is a tool for creating component based webpages.