codez-validates_by_schema 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -13
 - data/README.md +4 -2
 - data/lib/validates_by_schema.rb +17 -33
 - data/lib/validates_by_schema/validation_option.rb +27 -5
 - data/lib/validates_by_schema/version.rb +1 -1
 - metadata +18 -18
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,15 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                MjZhMWQ2ZDYxM2I4NmNmYTc5NDEzYWZkYjE4NjZjYzE2ODM2ZGQwYw==
         
     | 
| 
      
 2 
     | 
    
         
            +
            SHA1:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: e47e9a036c44ff2019dd4ad7ee301b0156cfd981
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: ad21446a8bdf496492e49347c0ffa3c0137d941f
         
     | 
| 
       7 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       8 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
                ZjQzYTEwZDgxOWI0MTA4MDJjNTgzMTA4NGVhMGFkM2YxZjk1ZGY3ZjE1Y2Nm
         
     | 
| 
       11 
     | 
    
         
            -
                YWI4ZWUxNWM3YmVjZjg1ZmY0YTdlYjJmZGViNjM5MjY5NjhmNWY=
         
     | 
| 
       12 
     | 
    
         
            -
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                MTMyNGQwYWEwNTM2Y2M5ZTVlZmE2NDBjNTA5OWY2NjdlYzU0MDgzYjFmMjE3
         
     | 
| 
       14 
     | 
    
         
            -
                OTg3ZDI3MWE5NGM2ODg4YjdhYTNjMDFkOTg4MjlkOGQ1ODY4MTg3NGUwN2Q4
         
     | 
| 
       15 
     | 
    
         
            -
                ZjkyNTM2YTY4Y2VkYWM3Yjg0MmI4YmY5YWQ3NzI0NDg0YjIxZjY=
         
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 54572f5a17cf304d29fce71b9cc253ff030cb1ed0a8c3be086a0a071dbaee678a8ed703c514d3ae66ff91bef9c96070a8acf7d5efdf47c8cd31bf41dec33ad37
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 3f68e9c4f5fc9cb66759bc13a0a967b755c441c1fdbcc455cbd212fc4e9230585ffda4ee7cad6d892256b8c8194fc17dbdc3f4feee0ed9219748b0e75cc63cd5
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,5 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Validates By Schema (validates_by_schema)
         
     | 
| 
       2 
     | 
    
         
            -
            [](http://travis-ci.org/joshwlewis/validates_by_schema) 
     | 
| 
      
 2 
     | 
    
         
            +
            [](http://travis-ci.org/joshwlewis/validates_by_schema)
         
     | 
| 
       3 
3 
     | 
    
         
             
            [](https://codeclimate.com/github/joshwlewis/validates_by_schema)
         
     | 
| 
       4 
4 
     | 
    
         
             
            [](https://gemnasium.com/joshwlewis/validates_by_schema)
         
     | 
| 
       5 
5 
     | 
    
         
             
            [](http://badge.fury.io/rb/validates_by_schema)
         
     | 
| 
         @@ -23,7 +23,7 @@ Then these validations are inferred when you add `validates_by_schema` to your m 
     | 
|
| 
       23 
23 
     | 
    
         
             
            ```ruby
         
     | 
| 
       24 
24 
     | 
    
         
             
            validates :quantity, numericality: { allow_nil: true,
         
     | 
| 
       25 
25 
     | 
    
         
             
              greater_than: -32768, less_than: 32768}
         
     | 
| 
       26 
     | 
    
         
            -
            validates :thickness, numericality: {allow_nil: true, 
     | 
| 
      
 26 
     | 
    
         
            +
            validates :thickness, numericality: {allow_nil: true,
         
     | 
| 
       27 
27 
     | 
    
         
             
              less_than_or_equal_to: 0.999, greater_than_or_equal_to: -0.999}
         
     | 
| 
       28 
28 
     | 
    
         
             
            validates :color, presence: true, length: {allow_nil: false, maximum: 255}
         
     | 
| 
       29 
29 
     | 
    
         
             
            ```
         
     | 
| 
         @@ -58,6 +58,8 @@ validates_by_schema only: [:body, :description] 
     | 
|
| 
       58 
58 
     | 
    
         
             
            validates_by_schema except: [:name, :title]
         
     | 
| 
       59 
59 
     | 
    
         
             
            ```
         
     | 
| 
       60 
60 
     | 
    
         | 
| 
      
 61 
     | 
    
         
            +
            The primary key and timestamp columns are not validated.
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
       61 
63 
     | 
    
         
             
            ## Notes
         
     | 
| 
       62 
64 
     | 
    
         | 
| 
       63 
65 
     | 
    
         
             
            Column properties are inferred by your database adapter (like pg, mysql2, sqlite3), and does not depend on migration files or schema.rb. As such, you could use this on projects where the database where Rails is not in control of the database configuration.
         
     | 
    
        data/lib/validates_by_schema.rb
    CHANGED
    
    | 
         @@ -4,55 +4,39 @@ module ValidatesBySchema 
     | 
|
| 
       4 
4 
     | 
    
         
             
              extend ActiveSupport::Concern
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
              module ClassMethods
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
       7 
8 
     | 
    
         
             
                def validates_by_schema(options = {})
         
     | 
| 
       8 
9 
     | 
    
         
             
                  return unless table_exists?
         
     | 
| 
       9 
10 
     | 
    
         | 
| 
       10 
     | 
    
         
            -
                   
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
                  define_validations(columns)
         
     | 
| 
       13 
     | 
    
         
            -
                  define_association_validations
         
     | 
| 
       14 
     | 
    
         
            -
                end
         
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
                def schema_validateable_columns
         
     | 
| 
       17 
     | 
    
         
            -
                  # Don't auto validate primary, foreign keys or timestamps
         
     | 
| 
       18 
     | 
    
         
            -
                  foreign_keys = all_foreign_keys
         
     | 
| 
       19 
     | 
    
         
            -
                  columns.reject do |c|
         
     | 
| 
       20 
     | 
    
         
            -
                    c.name == primary_key.to_s ||
         
     | 
| 
       21 
     | 
    
         
            -
                    %w(updated_at created_at).include?(c.name) ||
         
     | 
| 
       22 
     | 
    
         
            -
                    foreign_keys.include?(c.name)
         
     | 
| 
      
 11 
     | 
    
         
            +
                  customized_columns(options).each do |c|
         
     | 
| 
      
 12 
     | 
    
         
            +
                    ValidationOption.new(self, c).define!
         
     | 
| 
       23 
13 
     | 
    
         
             
                  end
         
     | 
| 
       24 
14 
     | 
    
         
             
                end
         
     | 
| 
       25 
15 
     | 
    
         | 
| 
       26 
     | 
    
         
            -
                 
     | 
| 
      
 16 
     | 
    
         
            +
                private
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                def customized_columns(options)
         
     | 
| 
       27 
19 
     | 
    
         
             
                  # Allow user to specify :only or :except options
         
     | 
| 
       28 
     | 
    
         
            -
                   
     | 
| 
       29 
     | 
    
         
            -
                     
     | 
| 
       30 
     | 
    
         
            -
                       
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
      
 20 
     | 
    
         
            +
                  schema_validateable_columns.tap do |columns|
         
     | 
| 
      
 21 
     | 
    
         
            +
                    { only: :select!, except: :reject! }.each do |k, v|
         
     | 
| 
      
 22 
     | 
    
         
            +
                      if options[k]
         
     | 
| 
      
 23 
     | 
    
         
            +
                        attrs = Array(options[k]).collect(&:to_s)
         
     | 
| 
      
 24 
     | 
    
         
            +
                        columns.send(v) { |c| attrs.include?(c.name) }
         
     | 
| 
      
 25 
     | 
    
         
            +
                      end
         
     | 
| 
       32 
26 
     | 
    
         
             
                    end
         
     | 
| 
       33 
27 
     | 
    
         
             
                  end
         
     | 
| 
       34 
28 
     | 
    
         
             
                end
         
     | 
| 
       35 
29 
     | 
    
         | 
| 
       36 
     | 
    
         
            -
                def  
     | 
| 
       37 
     | 
    
         
            -
                  columns. 
     | 
| 
       38 
     | 
    
         
            -
                     
     | 
| 
       39 
     | 
    
         
            -
                    validates c.name, vo if vo.present?
         
     | 
| 
      
 30 
     | 
    
         
            +
                def schema_validateable_columns
         
     | 
| 
      
 31 
     | 
    
         
            +
                  columns.reject do |c|
         
     | 
| 
      
 32 
     | 
    
         
            +
                    ignored_columns_for_validates_by_schema.include?(c.name)
         
     | 
| 
       40 
33 
     | 
    
         
             
                  end
         
     | 
| 
       41 
34 
     | 
    
         
             
                end
         
     | 
| 
       42 
35 
     | 
    
         | 
| 
       43 
     | 
    
         
            -
                def  
     | 
| 
       44 
     | 
    
         
            -
                   
     | 
| 
       45 
     | 
    
         
            -
                    column = columns_hash[association.foreign_key.to_s]
         
     | 
| 
       46 
     | 
    
         
            -
                    next unless column
         
     | 
| 
       47 
     | 
    
         
            -
                    validates association.name, presence: true unless column.null
         
     | 
| 
       48 
     | 
    
         
            -
                  end
         
     | 
| 
      
 36 
     | 
    
         
            +
                def ignored_columns_for_validates_by_schema
         
     | 
| 
      
 37 
     | 
    
         
            +
                  [primary_key.to_s, 'created_at', 'updated_at', 'deleted_at']
         
     | 
| 
       49 
38 
     | 
    
         
             
                end
         
     | 
| 
       50 
39 
     | 
    
         | 
| 
       51 
     | 
    
         
            -
                def all_foreign_keys
         
     | 
| 
       52 
     | 
    
         
            -
                  reflect_on_all_associations(:belongs_to).collect do |association|
         
     | 
| 
       53 
     | 
    
         
            -
                    association.foreign_key.to_s
         
     | 
| 
       54 
     | 
    
         
            -
                  end
         
     | 
| 
       55 
     | 
    
         
            -
                end
         
     | 
| 
       56 
40 
     | 
    
         
             
              end
         
     | 
| 
       57 
41 
     | 
    
         
             
            end
         
     | 
| 
       58 
42 
     | 
    
         | 
| 
         @@ -1,12 +1,24 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            class ValidatesBySchema::ValidationOption
         
     | 
| 
       2 
2 
     | 
    
         
             
              # column here must be an ActiveRecord column
         
     | 
| 
       3 
3 
     | 
    
         
             
              # i.e. MyARModel.columns.first
         
     | 
| 
       4 
     | 
    
         
            -
              attr_accessor :column
         
     | 
| 
      
 4 
     | 
    
         
            +
              attr_accessor :klass, :column
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
     | 
    
         
            -
              def initialize(column)
         
     | 
| 
      
 6 
     | 
    
         
            +
              def initialize(klass, column)
         
     | 
| 
      
 7 
     | 
    
         
            +
                @klass = klass
         
     | 
| 
       7 
8 
     | 
    
         
             
                @column = column
         
     | 
| 
       8 
9 
     | 
    
         
             
              end
         
     | 
| 
       9 
10 
     | 
    
         | 
| 
      
 11 
     | 
    
         
            +
              def define!
         
     | 
| 
      
 12 
     | 
    
         
            +
                if association
         
     | 
| 
      
 13 
     | 
    
         
            +
                  klass.validates association.name, presence: true unless column.null
         
     | 
| 
      
 14 
     | 
    
         
            +
                else
         
     | 
| 
      
 15 
     | 
    
         
            +
                  options = to_hash
         
     | 
| 
      
 16 
     | 
    
         
            +
                  klass.validates column.name, options if options.present?
         
     | 
| 
      
 17 
     | 
    
         
            +
                end
         
     | 
| 
      
 18 
     | 
    
         
            +
              end
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
              private
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
       10 
22 
     | 
    
         
             
              def presence?
         
     | 
| 
       11 
23 
     | 
    
         
             
                presence && column.type != :boolean
         
     | 
| 
       12 
24 
     | 
    
         
             
              end
         
     | 
| 
         @@ -15,8 +27,12 @@ class ValidatesBySchema::ValidationOption 
     | 
|
| 
       15 
27 
     | 
    
         
             
                !column.null
         
     | 
| 
       16 
28 
     | 
    
         
             
              end
         
     | 
| 
       17 
29 
     | 
    
         | 
| 
      
 30 
     | 
    
         
            +
              def enum?
         
     | 
| 
      
 31 
     | 
    
         
            +
                klass.respond_to?(:defined_enums) && klass.defined_enums.has_key?(column.name)
         
     | 
| 
      
 32 
     | 
    
         
            +
              end
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
       18 
34 
     | 
    
         
             
              def numericality?
         
     | 
| 
       19 
     | 
    
         
            -
                [:integer, :decimal, :float].include? 
     | 
| 
      
 35 
     | 
    
         
            +
                [:integer, :decimal, :float].include?(column.type) && !enum?
         
     | 
| 
       20 
36 
     | 
    
         
             
              end
         
     | 
| 
       21 
37 
     | 
    
         | 
| 
       22 
38 
     | 
    
         
             
              def numericality
         
     | 
| 
         @@ -27,7 +43,7 @@ class ValidatesBySchema::ValidationOption 
     | 
|
| 
       27 
43 
     | 
    
         
             
                    numericality[:less_than] = integer_max
         
     | 
| 
       28 
44 
     | 
    
         
             
                    numericality[:greater_than] = -integer_max
         
     | 
| 
       29 
45 
     | 
    
         
             
                  end
         
     | 
| 
       30 
     | 
    
         
            -
                elsif column.type == :decimal
         
     | 
| 
      
 46 
     | 
    
         
            +
                elsif column.type == :decimal && decimal_max
         
     | 
| 
       31 
47 
     | 
    
         
             
                  numericality[:less_than_or_equal_to] = decimal_max
         
     | 
| 
       32 
48 
     | 
    
         
             
                  numericality[:greater_than_or_equal_to] = -decimal_max
         
     | 
| 
       33 
49 
     | 
    
         
             
                end
         
     | 
| 
         @@ -56,7 +72,13 @@ class ValidatesBySchema::ValidationOption 
     | 
|
| 
       56 
72 
     | 
    
         
             
              end
         
     | 
| 
       57 
73 
     | 
    
         | 
| 
       58 
74 
     | 
    
         
             
              def decimal_max
         
     | 
| 
       59 
     | 
    
         
            -
                10.0**(column.precision - column.scale) - 10.0**(-column.scale)
         
     | 
| 
      
 75 
     | 
    
         
            +
                10.0**(column.precision - column.scale) - 10.0**(-column.scale) if column.precision && column.scale
         
     | 
| 
      
 76 
     | 
    
         
            +
              end
         
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
      
 78 
     | 
    
         
            +
              def association
         
     | 
| 
      
 79 
     | 
    
         
            +
                @association ||= klass.reflect_on_all_associations(:belongs_to).find do |a|
         
     | 
| 
      
 80 
     | 
    
         
            +
                  a.foreign_key.to_s == column.name
         
     | 
| 
      
 81 
     | 
    
         
            +
                end
         
     | 
| 
       60 
82 
     | 
    
         
             
              end
         
     | 
| 
       61 
83 
     | 
    
         | 
| 
       62 
84 
     | 
    
         
             
              def to_hash
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: codez-validates_by_schema
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.3. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Josh Lewis
         
     | 
| 
         @@ -9,104 +9,104 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2015-08- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2015-08-17 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: activerecord
         
     | 
| 
       16 
16 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       17 
17 
     | 
    
         
             
                requirements:
         
     | 
| 
       18 
     | 
    
         
            -
                - -  
     | 
| 
      
 18 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       19 
19 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       20 
20 
     | 
    
         
             
                    version: 3.1.0
         
     | 
| 
       21 
21 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       22 
22 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       23 
23 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       24 
24 
     | 
    
         
             
                requirements:
         
     | 
| 
       25 
     | 
    
         
            -
                - -  
     | 
| 
      
 25 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       26 
26 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       27 
27 
     | 
    
         
             
                    version: 3.1.0
         
     | 
| 
       28 
28 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       29 
29 
     | 
    
         
             
              name: rake
         
     | 
| 
       30 
30 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       31 
31 
     | 
    
         
             
                requirements:
         
     | 
| 
       32 
     | 
    
         
            -
                - -  
     | 
| 
      
 32 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       33 
33 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       34 
34 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       35 
35 
     | 
    
         
             
              type: :development
         
     | 
| 
       36 
36 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       37 
37 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       38 
38 
     | 
    
         
             
                requirements:
         
     | 
| 
       39 
     | 
    
         
            -
                - -  
     | 
| 
      
 39 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       40 
40 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       41 
41 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       42 
42 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       43 
43 
     | 
    
         
             
              name: rspec-rails
         
     | 
| 
       44 
44 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       45 
45 
     | 
    
         
             
                requirements:
         
     | 
| 
       46 
     | 
    
         
            -
                - -  
     | 
| 
      
 46 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       47 
47 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       48 
48 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       49 
49 
     | 
    
         
             
              type: :development
         
     | 
| 
       50 
50 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       51 
51 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       52 
52 
     | 
    
         
             
                requirements:
         
     | 
| 
       53 
     | 
    
         
            -
                - -  
     | 
| 
      
 53 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       54 
54 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       55 
55 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       56 
56 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       57 
57 
     | 
    
         
             
              name: shoulda-matchers
         
     | 
| 
       58 
58 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       59 
59 
     | 
    
         
             
                requirements:
         
     | 
| 
       60 
     | 
    
         
            -
                - -  
     | 
| 
      
 60 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       61 
61 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       62 
62 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       63 
63 
     | 
    
         
             
              type: :development
         
     | 
| 
       64 
64 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       65 
65 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       66 
66 
     | 
    
         
             
                requirements:
         
     | 
| 
       67 
     | 
    
         
            -
                - -  
     | 
| 
      
 67 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       68 
68 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       69 
69 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       70 
70 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       71 
71 
     | 
    
         
             
              name: sqlite3
         
     | 
| 
       72 
72 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       73 
73 
     | 
    
         
             
                requirements:
         
     | 
| 
       74 
     | 
    
         
            -
                - -  
     | 
| 
      
 74 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       75 
75 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       76 
76 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       77 
77 
     | 
    
         
             
              type: :development
         
     | 
| 
       78 
78 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       79 
79 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       80 
80 
     | 
    
         
             
                requirements:
         
     | 
| 
       81 
     | 
    
         
            -
                - -  
     | 
| 
      
 81 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       82 
82 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       83 
83 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       84 
84 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       85 
85 
     | 
    
         
             
              name: pg
         
     | 
| 
       86 
86 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       87 
87 
     | 
    
         
             
                requirements:
         
     | 
| 
       88 
     | 
    
         
            -
                - -  
     | 
| 
      
 88 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       89 
89 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       90 
90 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       91 
91 
     | 
    
         
             
              type: :development
         
     | 
| 
       92 
92 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       93 
93 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       94 
94 
     | 
    
         
             
                requirements:
         
     | 
| 
       95 
     | 
    
         
            -
                - -  
     | 
| 
      
 95 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       96 
96 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       97 
97 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       98 
98 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       99 
99 
     | 
    
         
             
              name: mysql2
         
     | 
| 
       100 
100 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       101 
101 
     | 
    
         
             
                requirements:
         
     | 
| 
       102 
     | 
    
         
            -
                - -  
     | 
| 
      
 102 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       103 
103 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       104 
104 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       105 
105 
     | 
    
         
             
              type: :development
         
     | 
| 
       106 
106 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       107 
107 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       108 
108 
     | 
    
         
             
                requirements:
         
     | 
| 
       109 
     | 
    
         
            -
                - -  
     | 
| 
      
 109 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       110 
110 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       111 
111 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       112 
112 
     | 
    
         
             
            description: Keep your code DRY by inferring column validations from table properties!
         
     | 
| 
         @@ -134,12 +134,12 @@ require_paths: 
     | 
|
| 
       134 
134 
     | 
    
         
             
            - lib
         
     | 
| 
       135 
135 
     | 
    
         
             
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
       136 
136 
     | 
    
         
             
              requirements:
         
     | 
| 
       137 
     | 
    
         
            -
              - -  
     | 
| 
      
 137 
     | 
    
         
            +
              - - ">="
         
     | 
| 
       138 
138 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       139 
139 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       140 
140 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       141 
141 
     | 
    
         
             
              requirements:
         
     | 
| 
       142 
     | 
    
         
            -
              - -  
     | 
| 
      
 142 
     | 
    
         
            +
              - - ">="
         
     | 
| 
       143 
143 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       144 
144 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       145 
145 
     | 
    
         
             
            requirements: []
         
     |