filter_form 0.7.11 → 0.7.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5dc2d33f248a859bb1271362aa5a4bc0a9ab4d0c
4
- data.tar.gz: d796580b49dadc0664727aebb3af65035e4513f5
3
+ metadata.gz: 7dc1544d27c25dda57fc4200dc6c60a61f2fe4bc
4
+ data.tar.gz: 8b6a229ecc41f3c992cca64d5539eeb55954b411
5
5
  SHA512:
6
- metadata.gz: 37c163f16d6fdcbd786c56be2ffeb255308048aaaaa31c0fa756f82e5c951946c32a6471986cb1e157de1b00005f9c2aa99a13e63470452cfdb5f7faff32ec0c
7
- data.tar.gz: 66a0e9475b22be8329809a99e59aa75a974bbd2d7ec42f8e76f049d3bc9cc1d82ef57050f2b1de0b3dcfab8a0fe7da5bcc0b6392f52291e3e6ed500f3ef87741
6
+ metadata.gz: 165ff100d5de2ff86276401ec8b978d02288f51037850bd98cfb0917dc39322f89494144449f04f5ab864bdd5e3d83316f7a7aefc68f4497f96f1e89b7109bc6
7
+ data.tar.gz: 016b6ad35e2f075d398a19b5e36cf3354cb152156bd4f38fa604ec8a98179dd4b10f67884131b69ce1d81d2af874290c86bb7ca85d9dd6003062d964f06fa18e
data/README.md CHANGED
@@ -60,6 +60,7 @@ In your view file:
60
60
  `select` | `belongs_to`/`has_many`/`has_and_belongs_to_many` associations | `eq` | `select` |
61
61
  `money` | [monetized](https://github.com/RubyMoney/money-rails) attribute | `eq` | `input[type="number"]` |
62
62
  `check_boxes` | `any' | `in` | `input[type=checkbox]` |
63
+ `radio_buttons` | `any' | `eq` | `input[type=radio]` |
63
64
 
64
65
  ### Customization
65
66
 
@@ -0,0 +1,21 @@
1
+ module FilterForm
2
+ module InputOptions
3
+ module RadioButtons
4
+ class Base < FilterForm::InputOptions::Base
5
+ include FilterForm::InputOptions::Shared::WithAssociations
6
+
7
+ DEFAULT_PREDICATE = :eq
8
+
9
+ private
10
+
11
+ def additional_options
12
+ {
13
+ as: :radio_buttons,
14
+ collection: collection,
15
+ checked: input_value
16
+ }
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -13,6 +13,8 @@ require 'filter_form/input_options/boolean/base'
13
13
 
14
14
  require 'filter_form/input_options/checkbox/base'
15
15
 
16
+ require 'filter_form/input_options/radio_buttons/base'
17
+
16
18
  module FilterForm
17
19
  class InputOptionsBuilder
18
20
  attr_accessor :attribute_name, :object, :custom_predicate, :custom_type
@@ -1,3 +1,3 @@
1
1
  module FilterForm
2
- VERSION = '0.7.11'
2
+ VERSION = '0.7.12'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filter_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.11
4
+ version: 0.7.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeny Li
@@ -144,6 +144,7 @@ files:
144
144
  - lib/filter_form/input_options/checkbox/base.rb
145
145
  - lib/filter_form/input_options/number/base.rb
146
146
  - lib/filter_form/input_options/number/money.rb
147
+ - lib/filter_form/input_options/radio_buttons/base.rb
147
148
  - lib/filter_form/input_options/select/base.rb
148
149
  - lib/filter_form/input_options/shared/with_associations.rb
149
150
  - lib/filter_form/input_options/string/base.rb