filter_form 0.6.1 → 0.6.2

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: 6f800cb6aaea8a59d82d5c4e103e445e2adbadab
4
- data.tar.gz: 07e42f1373ce8d42bf101372d4bdaec9dbe210f2
3
+ metadata.gz: d15e455964a95e853df84f34866dbbfd3453ddf8
4
+ data.tar.gz: 3a39ec88bc8f534a3943b0151edf4030dc2d9852
5
5
  SHA512:
6
- metadata.gz: 53c0115af667c010f1087661d680e186ef43b01cb247abd8cb6ac1236c39a474be9be75b7be4b79aa1bf5c4f6d906a7a93c16e6d041aae0a76859ef948a214db
7
- data.tar.gz: 65a55c70e9fd3c028f470c8d4fa8db138fe18b51f8f27a56bdca147eb42ffb7316a81a0d70e1e3de08d56b3af523eb9cfa3deb78490ff1ebc6a83004ff3c94c5
6
+ metadata.gz: caf8b95a46bde654bd666b09fdcca90254eb549143817194f2f42ba38bd76b40c4d1abe94a95a82e73d37b68921460beabc30ebf4d6e076b3875a9567eed56dd
7
+ data.tar.gz: 128383934a1b6f074d97a402d79df42744ae07cff1f18e9afbd8c543718874748ba9f1cd0bc4a1d1b63ecca3e080128b0cd4f97d866e11dc5054d763289f86e6
@@ -14,6 +14,7 @@ module FilterForm
14
14
  def default_options
15
15
  {
16
16
  required: false,
17
+ label: label,
17
18
  input_html: additional_input_options.merge(options.delete(:input_html) || {})
18
19
  }
19
20
  end
@@ -39,6 +40,14 @@ module FilterForm
39
40
  result
40
41
  end
41
42
 
43
+ def label
44
+ if options[:predicate_selector]
45
+ attribute_name.to_s.titleize
46
+ else
47
+ "#{ attribute_name }_#{ Ransack::Translate.predicate(predicate) }".titleize
48
+ end
49
+ end
50
+
42
51
  def current_predicate
43
52
  if object_condition
44
53
  object_condition.predicate.name
@@ -1,3 +1,3 @@
1
1
  module FilterForm
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
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.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeny Li