active_scaffold 3.5.3 → 3.5.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0a92ddd6c1b3401de801feb8488ec0e4a74d02eb91a7be59a9b28fe723c26f4
|
4
|
+
data.tar.gz: 832e014bbebf915d82c126ef5d552cf8f241461ca780dced5ec9df59771ae711
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 597fc2f0187a6c59e0f52f7a9a187ef85810f716334ee32fd37c362a21201c7b39111c39f8a5b29e9f4b38eb9702991e1a269e05062442f5157a2a0a9de1a815
|
7
|
+
data.tar.gz: dfad5b57b1bb177eaa1c8cc829a06fe85e1f4463605336fa5d67c1e3ad12c65cb285c15dbfcf2de04e9e0191c4fb172868dd2130f20a8a69b609fcf6790695d0
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
= 3.5.4
|
2
|
+
- Fix chosen form_ui for plural associations
|
3
|
+
- Eager load with includes in association options query, if includes has a hash with own association key, see #612
|
4
|
+
|
5
|
+
= 3.5.3
|
1
6
|
- Fix :text fields for rails >= 5.1
|
2
7
|
- Send empty array in collection associations with select form_ui (checkbox or draggable list) when no option is available
|
3
8
|
|
@@ -12,10 +12,11 @@ class ActiveScaffold::Bridges::Chosen
|
|
12
12
|
def active_scaffold_input_chosen(column, html_options)
|
13
13
|
html_options[:class] << ' chosen'
|
14
14
|
if column.association.try(:collection?)
|
15
|
-
|
16
|
-
|
15
|
+
record = html_options.delete(:object)
|
16
|
+
associated_options, select_options = active_scaffold_plural_association_options(column, record)
|
17
|
+
options = {selected: associated_options.collect(&:id), include_blank: as_(:_select_), object: record}
|
17
18
|
|
18
|
-
html_options.update(:
|
19
|
+
html_options.update(multiple: true).update(column.options[:html_options] || {})
|
19
20
|
options.update(column.options)
|
20
21
|
active_scaffold_select_name_with_multiple html_options
|
21
22
|
|
@@ -32,11 +32,11 @@ module ActiveScaffold
|
|
32
32
|
klass = association_klass_scoped(association, klass, record)
|
33
33
|
relation = klass.where(conditions)
|
34
34
|
column = column_for_association(association, record)
|
35
|
-
if column && column.
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
if column && column.includes
|
36
|
+
include_assoc = column.includes.find { |assoc| assoc.is_a?(Hash) && assoc.include?(association.name) }
|
37
|
+
relation = relation.includes(include_assoc[association.name]) if include_assoc
|
38
|
+
end
|
39
|
+
if column && column.sort && column.sort[:sql]
|
40
40
|
relation = relation.order(column.sort[:sql])
|
41
41
|
end
|
42
42
|
relation = yield(relation) if block_given?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Many, see README
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -430,7 +430,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
430
430
|
version: '0'
|
431
431
|
requirements: []
|
432
432
|
rubyforge_project:
|
433
|
-
rubygems_version: 2.7.
|
433
|
+
rubygems_version: 2.7.8
|
434
434
|
signing_key:
|
435
435
|
specification_version: 4
|
436
436
|
summary: Rails 4.x and 5.x versions of ActiveScaffold supporting prototype and jquery
|