lib/rasti/app/interaction.rb in rasti-app-0.0.2 vs lib/rasti/app/interaction.rb in rasti-app-0.0.3

- old
+ new

@@ -1,9 +1,11 @@ module Rasti class App class Interaction + include Rasti::Form::Validable + def self.build_form(params) constants.include?(:Form) ? const_get(:Form).new(params) : Form.new end def initialize(container, context) @@ -11,9 +13,10 @@ @context = context end def call(params) Thread.current[thread_form_key] = self.class.build_form(params) + validate! execute ensure Thread.current[thread_form_key] = nil end \ No newline at end of file