Sha256: ef1ee62ec9e0ce6ad0674c794ab141a052760672f27e6532db996dc665fd8f40

Contents?: true

Size: 402 Bytes

Versions: 10

Compression:

Stored size: 402 Bytes

Contents

module Micronaut
  module Rails
    module Extensions
      
      module ActiveRecord
        def errors_on(attribute)
          self.valid?
          [self.errors.on(attribute)].flatten.compact
        end
        alias :error_on :errors_on  
      end
      
    end
  end
end

if defined?(::ActiveRecord::Base)
  ::ActiveRecord::Base.send(:include, ::Micronaut::Rails::Extensions::ActiveRecord)
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
spicycode-micronaut-rails-0.2.4 lib/micronaut/rails/extensions/active_record.rb
spicycode-micronaut-rails-0.2.5 lib/micronaut/rails/extensions/active_record.rb
spicycode-micronaut-rails-0.2.6 lib/micronaut/rails/extensions/active_record.rb
spicycode-micronaut-rails-0.2.7 lib/micronaut/rails/extensions/active_record.rb
spicycode-micronaut-rails-0.3.0 lib/micronaut/rails/extensions/active_record.rb
spicycode-micronaut-rails-0.3.1 lib/micronaut/rails/extensions/active_record.rb
spicycode-micronaut-rails-0.3.2 lib/micronaut/rails/extensions/active_record.rb
micronaut-rails-1.0.1 lib/micronaut/rails/extensions/active_record.rb
micronaut-rails-1.0.0 lib/micronaut/rails/extensions/active_record.rb
micronaut-rails-0.3.3 lib/micronaut/rails/extensions/active_record.rb