lib/kosher/base.rb in kosher-0.11.0 vs lib/kosher/base.rb in kosher-0.11.1

- old
+ new

@@ -1,12 +1,11 @@ module Kosher - module Base - extend ActiveSupport::Concern + class Base < Structure include ActiveModel::Validations - included do - key :foo - key :kosher, Boolean, :default => true + def self.inherited(child) + child.key :foo + child.key :kosher, Boolean, :default => true end def kosher? unless valid? raise StandardError.new(errors.full_messages.join(', '))