Sha256: a1493e8460dfb6eff1336326a9603dcd5f4aa7fe839ba19d6c64fc477d7fba7d
Contents?: true
Size: 590 Bytes
Versions: 11
Compression:
Stored size: 590 Bytes
Contents
module Para module Admin module NestedInputsHelper # Helper that allows filling a parent association for a given resource, based on the # inverse_of option of the parent resource association. # def with_inverse_association_for(resource, attribute_name, parent_resource) resource.tap do association_name = parent_resource.association(attribute_name).options[:inverse_of] return resource unless association_name resource.association(association_name).send(:replace, parent_resource) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems