lib/readymade/operation.rb in readymade-0.1.3 vs lib/readymade/operation.rb in readymade-0.1.4
- old
+ new
@@ -12,9 +12,11 @@
def build_form
@form = form_class.new(record_params, record: record)
end
def form_valid?
+ build_form if @form.nil? && defined?(:build_form)
+
form.validate
end
def assign_attributes
record.assign_attributes(record_params)