Sha256: e646393afa7455c28af825a9f419495ce8d15f8eb430df2b92f79d3ccbd95996
Contents?: true
Size: 350 Bytes
Versions: 47
Compression:
Stored size: 350 Bytes
Contents
module Fields::DateSupport extend ActiveSupport::Concern def assign_date(strong_params, attribute) attribute = attribute.to_s if strong_params.dig(attribute).present? parsed_value = Chronic.parse(strong_params[attribute]) return nil unless parsed_value strong_params[attribute] = parsed_value.to_date end end end
Version data entries
47 entries across 47 versions & 1 rubygems