filter_form 0.7.3 → 0.7.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30ca8794d378251fef7fa980d22b7e8150070670
4
- data.tar.gz: 19592a90e5e25064c51dfa4715eb45683db0da6c
3
+ metadata.gz: 9adbbae8d73480ce1fce2c02e2f3167c0e677291
4
+ data.tar.gz: 5e95a42a620c695cf4b5f91899383f9db2e2e760
5
5
  SHA512:
6
- metadata.gz: 341ac63c03b79a58465943a6a60d4df642d2027e05f60dfa47a3f5bbd4106d31bb0d685b21578360050474a37ec138635983cacfe7354a33eb4a0c876f0eb8fd
7
- data.tar.gz: 94f370f5cafced86c15080d36bca08959e59f7496542603b41bd5bc5ce029882476b6c97168ed429ada99c333d16c046b5f523ccea3b4f10799f7ef525ddd9d4
6
+ metadata.gz: b37bcbbd277860589cf14bbf230ff745405ad1bd513281bf9d44fe852b4d33e1f088a7767318867a8acf0b2ad7629eded4bfc9a93eb5daae75752c99cd9eefbe
7
+ data.tar.gz: 33c0fdf413e10311e28f5b563d2a5373b59cfcce48f6710a425eb05cb59cc373aaeda992d4b3b4c8045474c62bbeab6abc658ba1fdb642a457638644ab4cf9e8
data/README.md CHANGED
@@ -40,7 +40,7 @@ In your view file:
40
40
  <%= f.filter_input :city # belongs_to %>
41
41
  <%= f.filter_input :parents # has_many %>
42
42
  <%= f.filter_input :amount # money %>
43
- <%= f.filter_input :gender, as: :check_boxes, collection: [[:male, 'Male'], [:female, 'Female']] # checkboxes %>
43
+ <%= f.filter_input :gender, as: :check_boxes, collection: [[:male, 'Male'], [:female, 'Female']] # checkboxes %>
44
44
  <%= f.button :submit %>
45
45
  <% end %>
46
46
  ```
@@ -5,10 +5,8 @@ module FilterForm
5
5
  def collection
6
6
  if options[:collection]
7
7
  options[:collection]
8
- elsif belongs_to?
9
- attribute_name.to_s.camelize.constantize.all
10
- elsif collection?
11
- attribute_name.to_s.camelize.singularize.constantize.all
8
+ elsif association
9
+ association.class_name.constantize.all
12
10
  else
13
11
  object.klass.uniq.pluck(attribute_name)
14
12
  end
@@ -17,14 +15,6 @@ module FilterForm
17
15
  def association
18
16
  object.klass.reflections[attribute_name]
19
17
  end
20
-
21
- def belongs_to?
22
- association && association.belongs_to?
23
- end
24
-
25
- def collection?
26
- association && association.collection?
27
- end
28
18
  end
29
19
  end
30
20
  end
@@ -1,3 +1,3 @@
1
1
  module FilterForm
2
- VERSION = '0.7.3'
2
+ VERSION = '0.7.4'
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.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeny Li