Sha256: 73b2c24e61ac6aa5d2b0ccadf7d89d2a7830892b1f1489a09bdf50f8eea93aae
Contents?: true
Size: 556 Bytes
Versions: 18
Compression:
Stored size: 556 Bytes
Contents
# kind of the evolution of the FormStruct module Edifice class FormModel include ActiveModel::Validations include ActiveModel::Conversion extend ActiveModel::Naming def initialize(attributes = {}) attributes.each { |n, v| send("#{n}=", v) if respond_to?("#{n}=") } end # default implementation, override as necessary def save valid? end def self.create(attributes = {}) form = new(attributes) form.save form end def persisted? false end end end
Version data entries
18 entries across 18 versions & 1 rubygems