filter_form 0.4.9 → 0.4.10
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/README.md +2 -0
- data/lib/filter_form/input_options/checkbox/base.rb +16 -0
- data/lib/filter_form/input_options_builder.rb +6 -0
- data/lib/filter_form/version.rb +1 -1
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 0b440c472101fe2f6148b6bbd267c8cb26b80a3f
         | 
| 4 | 
            +
              data.tar.gz: 6a2887fd96c81e42e2a7fbf2a2a40373a20b2b7a
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: c5d26bfb90ac2d85ba545020d74779225fd98056e93ac0ced2cfac0d95417c6edcaf94f346961a2868feeb029ecccc53d492e1b395013138b05da536ff23b930
         | 
| 7 | 
            +
              data.tar.gz: 824d7d344c077367ca4281fbd458627701889e3b94f58768ea0db9b537c099dcc0cf560e149876f8244e037cf9a437d0a7f56cda39bd9145b1f488c6b5d7c424
         | 
    
        data/README.md
    CHANGED
    
    | @@ -39,6 +39,7 @@ In your view file: | |
| 39 39 | 
             
              <%= f.filter_input :parents   # collection %>
         | 
| 40 40 | 
             
              <%= f.filter_input :birthday  # date       %>
         | 
| 41 41 | 
             
              <%= f.filter_input :amount    # money      %>
         | 
| 42 | 
            +
              <%= f.filter_input :married   # boolean    %>
         | 
| 42 43 | 
             
              <%= f.button :submit %>
         | 
| 43 44 | 
             
            <% end %>
         | 
| 44 45 | 
             
            ```
         | 
| @@ -55,6 +56,7 @@ In your view file: | |
| 55 56 | 
             
                 `belongs_to`    | `belongs_to` association                        | `eq`                  | `select`                  |
         | 
| 56 57 | 
             
                 `collection`    | `has_many` or `has_and_belongs_to_many` association | `eq`              | `select`                  |
         | 
| 57 58 | 
             
                 `money`         | `money` [monetized](https://github.com/RubyMoney/money-rails) attribute | `eq` | `input[type=text]` |
         | 
| 59 | 
            +
                 `boolean`       | `boolean`                                       | `true`                | `input[type=checkbox]`    |
         | 
| 58 60 |  | 
| 59 61 | 
             
            ### Customization
         | 
| 60 62 |  | 
| @@ -8,6 +8,8 @@ require 'filter_form/input_options/string/base' | |
| 8 8 | 
             
            require 'filter_form/input_options/string/date'
         | 
| 9 9 | 
             
            require 'filter_form/input_options/string/money'
         | 
| 10 10 |  | 
| 11 | 
            +
            require 'filter_form/input_options/checkbox/base'
         | 
| 12 | 
            +
             | 
| 11 13 | 
             
            module FilterForm
         | 
| 12 14 | 
             
              class InputOptionsBuilder
         | 
| 13 15 | 
             
                include ActiveModel::Model
         | 
| @@ -38,6 +40,8 @@ module FilterForm | |
| 38 40 | 
             
                  case type
         | 
| 39 41 | 
             
                  when :string
         | 
| 40 42 | 
             
                    :cont
         | 
| 43 | 
            +
                  when :boolean
         | 
| 44 | 
            +
                    :true
         | 
| 41 45 | 
             
                  else
         | 
| 42 46 | 
             
                    :eq
         | 
| 43 47 | 
             
                  end
         | 
| @@ -61,6 +65,8 @@ module FilterForm | |
| 61 65 | 
             
                    'select/collection'
         | 
| 62 66 | 
             
                  when :select2
         | 
| 63 67 | 
             
                    'select/select2'
         | 
| 68 | 
            +
                  when :boolean
         | 
| 69 | 
            +
                    'checkbox/base'
         | 
| 64 70 | 
             
                  else
         | 
| 65 71 | 
             
                    _type
         | 
| 66 72 | 
             
                  end
         | 
    
        data/lib/filter_form/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: filter_form
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.4. | 
| 4 | 
            +
              version: 0.4.10
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Evgeny Li
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2013-11- | 
| 11 | 
            +
            date: 2013-11-25 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: simple_form
         | 
| @@ -111,6 +111,7 @@ files: | |
| 111 111 | 
             
            - lib/filter_form.rb
         | 
| 112 112 | 
             
            - lib/filter_form/form_helper.rb
         | 
| 113 113 | 
             
            - lib/filter_form/input_options/base.rb
         | 
| 114 | 
            +
            - lib/filter_form/input_options/checkbox/base.rb
         | 
| 114 115 | 
             
            - lib/filter_form/input_options/select/base.rb
         | 
| 115 116 | 
             
            - lib/filter_form/input_options/select/belongs_to.rb
         | 
| 116 117 | 
             
            - lib/filter_form/input_options/select/collection.rb
         |