new_model in _list_with_header results in HasManyThroughNestedAssociationsAreReadonly

2017-07-03 Thread Jan Hebler
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

Re: new_model in _list_with_header results in HasManyThroughNestedAssociationsAreReadonly

2017-07-03 Thread Jan Hebler
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

Re: new_model in _list_with_header results in HasManyThroughNestedAssociationsAreReadonly

2017-07-06 Thread Jan Hebler
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

Is it possible to add group-clause to sort by?

2018-03-05 Thread Jan Hebler
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

Re: Is it possible to add group-clause to sort by?

2018-03-06 Thread Jan Hebler
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

Re: Is it possible to add group-clause to sort by?

2018-03-07 Thread Jan Hebler
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ó:

subform for has many relation

2020-03-10 Thread Jan Hebler
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