Sha256: 1e89740a8039de2d57a86cb1610761f2c363cce086b0eeaf9675b7088aa661ce

Contents?: true

Size: 487 Bytes

Versions: 2

Compression:

Stored size: 487 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'aequitas/contextual_rule_set'
require 'aequitas/macros'

module Aequitas
  module ClassMethods
    include Macros

    # Return the ContextualRuleSet for this model
    #
    # @api public
    def validation_rules
      @validation_rules ||= ContextualRuleSet.new
    end

  private

    # @api private
    def inherited(base)
      super
      base.validation_rules.concat(validation_rules)
    end

  end # module ClassMethods
end # module Aequitas

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aequitas-0.0.2 lib/aequitas/class_methods.rb
aequitas-0.0.1 lib/aequitas/class_methods.rb