Sha256: e69222cc57412f27dad8cb482d673d3759b5ad1e5d63dae562a0dbd6729aa0e1

Contents?: true

Size: 305 Bytes

Versions: 12

Compression:

Stored size: 305 Bytes

Contents

module WhyValidationsSuckIn96
  class ValidationCollection < Array

    def to_json(options={})
      inject({}) do |acc,validation|
        acc[validation.attribute] = validation.options
        acc
      end.to_json(options)
    end

    def select(&block)
      self.class.new super
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
whyvalidationssuckin96-1.6.2 lib/whyvalidationssuckin96/validation_collection.rb
whyvalidationssuckin96-1.6.1 lib/whyvalidationssuckin96/validation_collection.rb
whyvalidationssuckin96-1.6.0 lib/whyvalidationssuckin96/validation_collection.rb
whyvalidationssuckin96-1.5.5 lib/whyvalidationssuckin96/validation_collection.rb
whyvalidationssuckin96-1.5.4 lib/whyvalidationssuckin96/validation_collection.rb
whyvalidationssuckin96-1.5.3 lib/whyvalidationssuckin96/validation_collection.rb
whyvalidationssuckin96-1.5.2 lib/whyvalidationssuckin96/validation_collection.rb
whyvalidationssuckin96-1.5.1 lib/whyvalidationssuckin96/validation_collection.rb
whyvalidationssuckin96-1.5.0 lib/whyvalidationssuckin96/validation_collection.rb
whyvalidationssuckin96-1.4.0 lib/whyvalidationssuckin96/validation_collection.rb
whyvalidationssuckin96-1.3.1 lib/whyvalidationssuckin96/validation_collection.rb
whyvalidationssuckin96-1.3.0 lib/whyvalidationssuckin96/validation_collection.rb