Sha256: 9ce18029c73f20374500731aecd69bdd13328c5bd2fcd25516f972bace198132
Contents?: true
Size: 1.28 KB
Versions: 11
Compression:
Stored size: 1.28 KB
Contents
# frozen_string_literal: true module Tramway::Core::ExtendableFormsHelpers::ClassBuilder def build_form_class(name, simple_properties, more_properties) Object.const_set(name, Class.new(::Tramway::Core::ApplicationForm) do properties(*simple_properties.keys) if simple_properties.keys.any? include Tramway::Core::ExtendableFormsHelpers::Submit::ObjectHelpers include Tramway::Core::ExtendableFormsHelpers::Validators extend Tramway::Core::ExtendableFormsHelpers::Submit::ClassHelpers extend Tramway::Core::ExtendableFormsHelpers::PropertiesHelper extend Tramway::Core::ExtendableFormsHelpers::MorePropertiesHelper extend Tramway::Core::ExtendableFormsHelpers::IgnoredPropertiesHelper define_submit_method simple_properties, more_properties define_properties_method simple_properties, more_properties define_ignored_properties_method more_properties.each do |property| define_property_method property[0] case property[1][:object].field_type when 'file' field = property[1][:object] define_file_property_assignment_method property field else next unless property[1][:validates].present? define_assignment_method property end end end) end end
Version data entries
11 entries across 11 versions & 1 rubygems