effective_bootstrap 1.14.2 → 1.14.3
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 +4 -4
- data/app/models/effective/table_builder.rb +6 -2
- data/lib/effective_bootstrap/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: 4fa93cb9e48b8d3d2178adf482bb9ca80e0c3031d8a5096e54d913d31729111e
|
4
|
+
data.tar.gz: 01ae7c70458e2e2622048bd1fd0e348043d527d079ca6083679678ae855880c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9752969090369e1dc87953e16302bd3a9c1356a92e50e102ec3a6ffc414baf521cd0a4303a92ee129c16d23b52d0f4d32b0f1a30e686aefa207d6201ae59baf1
|
7
|
+
data.tar.gz: bc82b1459210f5f17ceb990701f99f0aec47092308f4c3eae8a878e36b873cc4731f2b0ad84b4dd4b28d89710b50c833ad5387a005d76a1434ba8d82325a683b
|
@@ -28,7 +28,7 @@ module Effective
|
|
28
28
|
capture(&block) if block_given?
|
29
29
|
|
30
30
|
# Build from the resource if we didn't do anything in the block
|
31
|
-
build_resource_rows if rows.blank?
|
31
|
+
build_resource_rows if rows.blank? && !block_given?
|
32
32
|
|
33
33
|
only = Array(options[:only])
|
34
34
|
except = Array(options[:except])
|
@@ -191,7 +191,11 @@ module Effective
|
|
191
191
|
|
192
192
|
# Has Many
|
193
193
|
def has_many(name, collection = nil, options = {}, &block)
|
194
|
-
|
194
|
+
value(name).each_with_index do |object, index|
|
195
|
+
builder = TableBuilder.new(object, template, options.merge(prefix: human_attribute_name(name).singularize + " ##{index+1}"))
|
196
|
+
builder.render(&block)
|
197
|
+
builder.rows.each { |child, content| rows["#{name}_#{child}_#{index}".to_sym] = content }
|
198
|
+
end
|
195
199
|
end
|
196
200
|
|
197
201
|
def fields_for(name, object, options = {}, &block)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.14.
|
4
|
+
version: 1.14.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|