Solution for: #35: validating date_select in rails

override assign_multiparameter_attributes

2
I ended up overriding assign_multiparameter_attributes to look for empty fields. Obviously, this will break non-date multiparam assignments, but I'm hoping that will be ok in my case.

In my model:

def assign_multiparameter_attributes(pairs) pair_values = Hash[pairs].values if pair_values.collect(&:blank?).include?(true) && pair_values.collect(&:blank?).uniq.include?(false) @incomplete_date = true else super(pairs) end end def validate if @incomplete_date self.errors.add_to_base("The date you entered is incomplete!") end end