simple_form 1.2.1 → 1.2.2

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.
@@ -96,25 +96,27 @@ module SimpleForm
96
96
  fields_for(*(args << options), &block)
97
97
  end
98
98
 
99
- private
99
+ private
100
100
 
101
- # Generate default options for collection helpers, such as :checked and
102
- # :disabled.
103
- def default_html_options_for_collection(item, value, options, html_options) #:nodoc:
104
- returning(html_options.dup) do |default_html_options|
105
- [:checked, :disabled].each do |option|
106
- next unless options[option]
101
+ # Generate default options for collection helpers, such as :checked and
102
+ # :disabled.
103
+ def default_html_options_for_collection(item, value, options, html_options) #:nodoc:
104
+ html_options = html_options.dup
107
105
 
108
- accept = if options[option].is_a?(Proc)
109
- options[option].call(item)
110
- else
111
- Array(options[option]).include?(value)
112
- end
106
+ [:checked, :disabled].each do |option|
107
+ next unless options[option]
113
108
 
114
- default_html_options[option] = true if accept
115
- end
109
+ accept = if options[option].is_a?(Proc)
110
+ options[option].call(item)
111
+ else
112
+ Array(options[option]).include?(value)
116
113
  end
114
+
115
+ html_options[option] = true if accept
117
116
  end
117
+
118
+ html_options
119
+ end
118
120
  end
119
121
  end
120
122
  end
@@ -147,7 +147,7 @@ module SimpleForm
147
147
  :conditions => @reflection.options[:conditions], :order => @reflection.options[:order]
148
148
  )
149
149
 
150
- returning(input(attribute, options)) { @reflection = nil }
150
+ input(attribute, options).tap { @reflection = nil }
151
151
  end
152
152
 
153
153
  # Creates a button:
@@ -1,3 +1,3 @@
1
1
  module SimpleForm
2
- VERSION = "1.2.1".freeze
2
+ VERSION = "1.2.2".freeze
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 1
10
- version: 1.2.1
9
+ - 2
10
+ version: 1.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Jos\xC3\xA9 Valim"
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-07-24 00:00:00 +02:00
19
+ date: 2010-07-27 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies: []
22
22