Module to use similar model multiple params assignment and dates with multiparams (params["date(1i)"], params["date(2i)"], params["date(3i)"]) in a non ActiveModel class.
class Sample
include ActiveModel::Multiassignment
attr_accessor :name, :date
multiparameter_dates :date
end
params[:sample] = {
"name" => "John Doe",
"date(1i)" => 2000,
"date(2i)" => 1,
"date(3i)" => 1
}
sample = Sample.new params[:sample]
=> #<Sample:0x007fdf19b4cb70 @date=Sat, 01 Jan 2000, @name="John Doe">