Sha256: 8cbbfb77da171095ee59df7333cfb8c33175a725a2561d05d3b33029e2188198
Contents?: true
Size: 382 Bytes
Versions: 10
Compression:
Stored size: 382 Bytes
Contents
module Detour::Concerns module Keepable extend ActiveSupport::Concern included do attr_writer :to_keep end def to_keep @to_keep || (!marked_for_destruction? && !new_record?) end def keep_or_destroy(params = {}) if params["to_keep"] == "1" self.to_keep = true else mark_for_destruction end end end end
Version data entries
10 entries across 10 versions & 1 rubygems