Hi
I have an rather complex Data-Model:
class Node
has_one :node2server
has_one :server, :through => node2server
has_many :errata, through => :server
end
class Node2server
belongs_to :node
belongs_to :server
end
class Server
has_one :node2server
has_one :node
has_and_belongs_to_ma
Jan
>
> El lunes, 3 de julio de 2017, 22:17:02 (UTC+2), Jan Hebler escribió:
>>
>> Hi
>>
>> I have an rather complex Data-Model:
>>
>> class Node
>> has_one :node2server
>> has_one :server, :through => node2server
>> has_many :err
iding new_model:
>
> def new_model
> nested? && nested.association.through? ? Erratum.new : super
> end
>
> Or simply, return Erratum.new always:
>
> def new_model
> Erratum.new
> end
>
> El martes, 4 de julio de 2017 5:02:14 (CEST) Jan Heb
Hi
I want to sort by an calculation on an associated table, i.E.
config.columns[:findings].includes = [ :vulnerabilities ]
config.columns[:findings].sort_by :sql => 'sum(vulnerabilities.score)'
This doesn't work as AS don't set the necessary "group by"-clause:
ActionView::Template::Er
ode" LEFT OUTER
JOIN "findings" ON "findings"."system_id" = "tbl_node"."node_id" AND
(findingstate_id != 4) LEFT OUTER JOIN "vulnerabilities" ON
"vulnerabilities"."id" = "findings"."vulnerability_id" WHERE
ext
try will to add an subquery via the custom_finder_options and sort by the
result. However, this ist not an esay task for me, so i will delay it for
now and stay with the slow function-based sorting.
Thank You, Jan
> El miércoles, 7 de marzo de 2018 7:35:18 (CET) Jan Hebler escribió:
Hi
is it possible to edit an has_many relation with an subform? I imagine an
subform which shows ALL objects, not only the related objects with an
additional checkbox. The checkbox is true if the object is related and
false otherwise. If i change the checkbox(es), the relations should be
upda