active_enum 1.0.0.rc5 → 1.0.0.rc6
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 +4 -4
- data/.travis.yml +7 -7
- data/gemfiles/rails_4_2.gemfile +16 -0
- data/gemfiles/rails_5_0.gemfile +16 -0
- data/gemfiles/rails_5_1.gemfile +16 -0
- data/gemfiles/rails_5_2.gemfile +16 -0
- data/lib/active_enum/acts_as_enum.rb +3 -3
- data/lib/active_enum/version.rb +1 -1
- metadata +9 -5
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: a6fb4a88a4e4c0b8894a94b35dee75c23f9ddbdba0db2c5078dd51049cbeb82a
         | 
| 4 | 
            +
              data.tar.gz: 53e5d91603101b6c0e6590ceb58f6c214cbd221be7da6e4780825b51e71b640f
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b208b4ad29373d4f604673eef17315d5ede6265384d0cb3cadda81b674953fa35d09ac8149a2831a257d2f4e05e9931b02c01767aece9b2a7e45e4152f09e462
         | 
| 7 | 
            +
              data.tar.gz: 8ef7bde84f962ac14307dccfee60849d022699c2841fabd7fe33cb5b4c284cafcff938e91497a6f44f02df27fc0cd0d7bbf707162b16663df30ad61d63688f08
         | 
    
        data/.travis.yml
    CHANGED
    
    | @@ -1,8 +1,8 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
              -  | 
| 3 | 
            -
              -  | 
| 4 | 
            -
              -  | 
| 5 | 
            -
              -  | 
| 1 | 
            +
            gemfile:
         | 
| 2 | 
            +
              - gemfiles/rails_4_2.gemfile
         | 
| 3 | 
            +
              - gemfiles/rails_5_0.gemfile
         | 
| 4 | 
            +
              - gemfiles/rails_5_1.gemfile
         | 
| 5 | 
            +
              - gemfiles/rails_5_2.gemfile
         | 
| 6 6 | 
             
            rvm:
         | 
| 7 | 
            -
              -  | 
| 8 | 
            -
              - 2. | 
| 7 | 
            +
              - 2.5.8
         | 
| 8 | 
            +
              - 2.6.6
         | 
| @@ -0,0 +1,16 @@ | |
| 1 | 
            +
            # This file was generated by Appraisal
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            source "http://rubygems.org"
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            gem "rails", "~> 4.2.11"
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            gem 'sqlite3', '~> 1.3.0'
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            gem 'rake'
         | 
| 10 | 
            +
            gem 'simple_form', '~> 3.0'
         | 
| 11 | 
            +
            gem 'byebug'
         | 
| 12 | 
            +
            gem 'rspec', '~> 3.4'
         | 
| 13 | 
            +
            gem 'rspec-rails', '~> 3.4'
         | 
| 14 | 
            +
            gem 'capybara'
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            gemspec path: "../"
         | 
| @@ -0,0 +1,16 @@ | |
| 1 | 
            +
            # This file was generated by Appraisal
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            source "http://rubygems.org"
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            gem "rails", "~> 5.1.0"
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            gem 'sqlite3', '~> 1.3.0'
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            gem 'rake'
         | 
| 10 | 
            +
            gem 'simple_form', '~> 5.0'
         | 
| 11 | 
            +
            gem 'byebug'
         | 
| 12 | 
            +
            gem 'rspec', '~> 3.4'
         | 
| 13 | 
            +
            gem 'rspec-rails', '~> 3.4'
         | 
| 14 | 
            +
            gem 'capybara'
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            gemspec path: "../"
         | 
| @@ -0,0 +1,16 @@ | |
| 1 | 
            +
            # This file was generated by Appraisal
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            source "http://rubygems.org"
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            gem "rails", "~> 5.1.0"
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            gem 'sqlite3', '~> 1.3.0'
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            gem 'rake'
         | 
| 10 | 
            +
            gem 'simple_form', '~> 5.0'
         | 
| 11 | 
            +
            gem 'byebug'
         | 
| 12 | 
            +
            gem 'rspec', '~> 3.4'
         | 
| 13 | 
            +
            gem 'rspec-rails', '~> 3.4'
         | 
| 14 | 
            +
            gem 'capybara'
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            gemspec path: "../"
         | 
| @@ -0,0 +1,16 @@ | |
| 1 | 
            +
            # This file was generated by Appraisal
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            source "http://rubygems.org"
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            gem "rails", "~> 5.2.0"
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            gem 'sqlite3', '~> 1.3.0'
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            gem 'rake'
         | 
| 10 | 
            +
            gem 'simple_form', '~> 5.0'
         | 
| 11 | 
            +
            gem 'byebug'
         | 
| 12 | 
            +
            gem 'rspec', '~> 3.4'
         | 
| 13 | 
            +
            gem 'rspec-rails', '~> 3.4'
         | 
| 14 | 
            +
            gem 'capybara'
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            gemspec path: "../"
         | 
| @@ -7,9 +7,9 @@ module ActiveEnum | |
| 7 7 | 
             
                    extend ClassMethods
         | 
| 8 8 | 
             
                    class_attribute :active_enum_options
         | 
| 9 9 | 
             
                    self.active_enum_options = options.reverse_merge(:name_column => 'name')
         | 
| 10 | 
            -
                    scope :enum_values, proc { select("#{primary_key}, #{active_enum_options[:name_column]}").
         | 
| 10 | 
            +
                    scope :enum_values, proc { select(Arel.sql("#{primary_key}, #{active_enum_options[:name_column]}")).
         | 
| 11 11 | 
             
                                               where(active_enum_options[:conditions]).
         | 
| 12 | 
            -
                                               order("#{primary_key} #{active_enum_options[:order]}") }
         | 
| 12 | 
            +
                                               order(Arel.sql("#{primary_key} #{active_enum_options[:order]}")) }
         | 
| 13 13 | 
             
                  end
         | 
| 14 14 |  | 
| 15 15 | 
             
                end
         | 
| @@ -63,7 +63,7 @@ module ActiveEnum | |
| 63 63 | 
             
                    if index.is_a?(Integer)
         | 
| 64 64 | 
             
                      enum_values.where(id: index)
         | 
| 65 65 | 
             
                    else
         | 
| 66 | 
            -
                      enum_values.where("#{active_enum_options[:name_column]}  | 
| 66 | 
            +
                      enum_values.where("lower(#{active_enum_options[:name_column]}) = lower(?)", Arel.sql(index.to_s))
         | 
| 67 67 | 
             
                    end
         | 
| 68 68 | 
             
                  end
         | 
| 69 69 | 
             
                end
         | 
    
        data/lib/active_enum/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: active_enum
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0.0. | 
| 4 | 
            +
              version: 1.0.0.rc6
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Adam Meehan
         | 
| 8 | 
            -
            autorequire: | 
| 8 | 
            +
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2020- | 
| 11 | 
            +
            date: 2020-07-01 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activesupport
         | 
| @@ -39,6 +39,10 @@ files: | |
| 39 39 | 
             
            - README.rdoc
         | 
| 40 40 | 
             
            - Rakefile
         | 
| 41 41 | 
             
            - active_enum.gemspec
         | 
| 42 | 
            +
            - gemfiles/rails_4_2.gemfile
         | 
| 43 | 
            +
            - gemfiles/rails_5_0.gemfile
         | 
| 44 | 
            +
            - gemfiles/rails_5_1.gemfile
         | 
| 45 | 
            +
            - gemfiles/rails_5_2.gemfile
         | 
| 42 46 | 
             
            - init.rb
         | 
| 43 47 | 
             
            - lib/active_enum.rb
         | 
| 44 48 | 
             
            - lib/active_enum/acts_as_enum.rb
         | 
| @@ -68,7 +72,7 @@ files: | |
| 68 72 | 
             
            homepage: http://github.com/adzap/active_enum
         | 
| 69 73 | 
             
            licenses: []
         | 
| 70 74 | 
             
            metadata: {}
         | 
| 71 | 
            -
            post_install_message: | 
| 75 | 
            +
            post_install_message:
         | 
| 72 76 | 
             
            rdoc_options: []
         | 
| 73 77 | 
             
            require_paths:
         | 
| 74 78 | 
             
            - lib
         | 
| @@ -84,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 84 88 | 
             
                  version: 1.3.1
         | 
| 85 89 | 
             
            requirements: []
         | 
| 86 90 | 
             
            rubygems_version: 3.0.3
         | 
| 87 | 
            -
            signing_key: | 
| 91 | 
            +
            signing_key:
         | 
| 88 92 | 
             
            specification_version: 4
         | 
| 89 93 | 
             
            summary: Define enum classes in Rails and use them to enumerate ActiveRecord attributes
         | 
| 90 94 | 
             
            test_files:
         |