Sha256: 1ec56b9b77d194cd578dfa4b49acc95a2dc1353961cf07a861f26e4816b39e69

Contents?: true

Size: 371 Bytes

Versions: 1

Compression:

Stored size: 371 Bytes

Contents

module Commandos
  module Plugins
    module ActiveModelPlugin
      module ClassMethods
        def self.extended(object)
          object.send(:include, ActiveModel::Validations)
        end
      end

      module InstanceMethods
        def valid?
          @valid ||= super
        end

        def invalid?
          !valid?
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
commandos-activemodel-0.1.2 lib/commandos_activemodel/plugins/validations_plugin.rb