hungryform 0.0.10 → 0.0.11

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: c55e397d5568ee783aa7a4c10579676ed50314bf
4
- data.tar.gz: 23e0adea07adeaa6b2d3d613a48b32a79402bf7c
3
+ metadata.gz: bd121fa51d237a9aa98ceaccb34d097b1dcda71c
4
+ data.tar.gz: 0b7015d45bc45feec5a378932407b331d69346cf
5
5
  SHA512:
6
- metadata.gz: 883d982d48448c144de2d9e6dcbbe97db6f49e59b4e97372031cbacaa8a19e16bfea8e20b2f9276e61d9496ac49a7939087bdfb2b1d79e34c07ce92b394c9366
7
- data.tar.gz: aafb593254ac8fd69158b9990bd2d2bac90a2afc5dbf56714a0fda95fa8d4dd746bb124564600b94cd14db3fe21b3e1c74f6b45404a7f8d758b0e3c749639c4d
6
+ metadata.gz: 611492f408704f5447aaed13235a75ffda2f28e4f9683c5869c596ae54fa702ccf5de565edb49011a17175176c99b9aa15ef89b005e5dbd40c2547479270dc46
7
+ data.tar.gz: 7ee7a69c06e99581f8eb4b6f31ea8e8cfbe270d74fc9c3d3661763c372385b42c989e7935035ec6311f7312042755d96299967a7f8e866b086c112202bc43c62
@@ -1,10 +1,6 @@
1
1
  module HungryForm
2
2
  class Configuration
3
- attr_accessor :views_prefix
4
-
5
3
  def initialize
6
- @views_prefix = 'hungryform'
7
-
8
4
  init_element_default_attributes
9
5
  end
10
6
 
@@ -4,7 +4,7 @@ module HungryForm
4
4
  def set_value
5
5
  self.value = resolver.params[name] || attributes.delete(:value) || 0
6
6
 
7
- if value == 0
7
+ if value.to_i == 0
8
8
  attributes.delete(:checked)
9
9
  else
10
10
  self.value = 1
@@ -24,7 +24,7 @@ module HungryForm
24
24
 
25
25
  def initialize(name, parent, resolver, attributes = {}, &block)
26
26
  super
27
- self.title ||= label
27
+ self.title = attributes[:title] || label
28
28
  end
29
29
 
30
30
  def to_s
@@ -16,12 +16,12 @@ module HungryForm
16
16
  # Check if all of the values from the resolver params are present
17
17
  # in the options.
18
18
  def acceptable_values?
19
- options_sym_keys = options.keys.map(&:to_sym)
19
+ options_s_keys = options.keys.map(&:to_s)
20
20
 
21
21
  if @attributes[:multiple] && resolver.params[name].respond_to?(:map)
22
- (resolver.params[name].map(&:to_sym) - options_sym_keys).empty?
22
+ (resolver.params[name].map(&:to_s) - options_s_keys).empty?
23
23
  else
24
- options_sym_keys.include?(resolver.params[name].to_sym)
24
+ options_s_keys.include?(resolver.params[name].to_s)
25
25
  end
26
26
  end
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module HungryForm
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -38,14 +38,6 @@ describe HungryForm do
38
38
  end
39
39
 
40
40
  describe ".configure" do
41
- it "sets a new views prefix" do
42
- HungryForm.configure do |config|
43
- config.views_prefix = '/new/prefix'
44
- end
45
-
46
- expect(HungryForm.configuration.views_prefix).to eq '/new/prefix'
47
- end
48
-
49
41
  it "configures default element options" do
50
42
  HungryForm.configure do |config|
51
43
  config.text_field my_attr: 100
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hungryform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Bazhutkin