mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
ArrayFormatter now returns arrays for has_many :through associations
The array_formatter was always returning an empty array when associated objects were called via a `has_many through:` relationship because they are loaded as a collection, and the collection is always considered empty. resolves: https://github.com/awesome-print/awesome_print/issues/331
This commit is contained in:
parent
b95767e16b
commit
3b052a4f5e
2 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
## master (unreleased)
|
## master (unreleased)
|
||||||
- new things!
|
- ArrayFormatter now returns arrays for has_many :through associations [@chadh13] - [#332]
|
||||||
|
|
||||||
## 1.8.0
|
## 1.8.0
|
||||||
- stat("$HOME/.aprc") once [@kstephens] - [#304]
|
- stat("$HOME/.aprc") once [@kstephens] - [#304]
|
||||||
|
|
|
@ -12,7 +12,7 @@ module AwesomePrint
|
||||||
end
|
end
|
||||||
|
|
||||||
def format
|
def format
|
||||||
if array.empty?
|
if array.length.zero?
|
||||||
'[]'
|
'[]'
|
||||||
elsif methods_array?
|
elsif methods_array?
|
||||||
methods_array
|
methods_array
|
||||||
|
|
Loading…
Reference in a new issue