simple_form_ransack 0.0.6 → 0.0.7

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: dff5505ced9fb7a26b27d1a9a50a429356f5ccac
4
- data.tar.gz: 0dda45cf2b733497a1d8c4599833acdb4b817096
3
+ metadata.gz: 8bf0d09cf759f75b2f06b555c2ab33721f06d36b
4
+ data.tar.gz: 8a54387e3b835ebd68a53a61c9773e1b5023c0ac
5
5
  SHA512:
6
- metadata.gz: 32737d04bb85cae9b2703e03841cb7b71e1ec747f314ed016b3f6ce492a5b5def4adf0ef6312f2e484367e97ac8b0baa7c709f721d1f90d3f743b4e888f539f0
7
- data.tar.gz: e75f044227db0c2babe677d5ba97109e07f80ac90e78ce227d108d1b4fc11f128e9bfd0da54f3fda31239a155b50f72a9fdd2f1d5e6b762a2bf2a6a5c806faeb
6
+ metadata.gz: e687398d0bd4dcc8e8eeab8dcbf0c795e38028a5910209b758e10e897304b3c63c0966fe3cee3f1076416b5b24218e112d48d319a6156cee493b96d7bd191c7b
7
+ data.tar.gz: 85766928afba1b324409900f0a273b09fec46ffab504468a0177973e161c8ffa32dec4dad27419cd23b086d2b0851ddf122db49feb4fdaf82a83cf414943071d
@@ -17,7 +17,7 @@ class SimpleFormRansack::FormProxy
17
17
  end
18
18
 
19
19
  attribute_name = real_name(name, opts)
20
- as = as_from_opts(opts)
20
+ as = as_from_opts(attribute_name, opts)
21
21
  input_html = opts.delete(:input_html) || {}
22
22
  set_value(as, name, opts, input_html)
23
23
  set_name(as, name, input_html)
@@ -72,6 +72,14 @@ private
72
72
  opts[:checked] = ""
73
73
  end
74
74
  end
75
+ elsif as == "boolean"
76
+ if !input_html.key?(:checked)
77
+ if @params[name] == "1"
78
+ input_html[:checked] = "checked"
79
+ else
80
+ input_html[:checked] = nil
81
+ end
82
+ end
75
83
  else
76
84
  if !input_html.key?(:value)
77
85
  if @params[name]
@@ -91,13 +99,19 @@ private
91
99
  end
92
100
  end
93
101
 
94
- def as_from_opts(opts)
102
+ def as_from_opts(attribute_name, opts)
95
103
  if opts[:as].present?
96
104
  return opts[:as].to_s
97
105
  elsif opts[:collection]
98
106
  return "select"
99
107
  end
100
108
 
109
+ if column = @class.columns_hash[attribute_name]
110
+ if column.type == :boolean
111
+ return "boolean"
112
+ end
113
+ end
114
+
101
115
  return "text"
102
116
  end
103
117
 
@@ -1,3 +1,3 @@
1
1
  module SimpleFormRansack
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,125 +1,139 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_ransack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Johansen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-03 00:00:00.000000000 Z
11
+ date: 2015-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.5
19
+ version: 4.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.5
26
+ version: 4.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sqlite3
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: factory_girl_rails
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: forgery
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: ransack
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: haml-rails
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: simple_form
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: codeclimate-test-reporter
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
123
137
  - !ruby/object:Gem::Version
124
138
  version: '0'
125
139
  description: Makes it easy to use SimpleForm::FormBuilder with Ransack without constantly
@@ -130,14 +144,14 @@ executables: []
130
144
  extensions: []
131
145
  extra_rdoc_files: []
132
146
  files:
147
+ - MIT-LICENSE
148
+ - Rakefile
133
149
  - app/helpers/simple_form_ransack_helper.rb
134
150
  - lib/simple_form_ransack.rb
135
- - lib/simple_form_ransack/version.rb
136
- - lib/simple_form_ransack/form_proxy.rb
137
151
  - lib/simple_form_ransack/attribute_inspector.rb
152
+ - lib/simple_form_ransack/form_proxy.rb
153
+ - lib/simple_form_ransack/version.rb
138
154
  - lib/tasks/simple_form_ransack_tasks.rake
139
- - MIT-LICENSE
140
- - Rakefile
141
155
  homepage: https://www.github.com/kaspernj/simple_form_ransack
142
156
  licenses: []
143
157
  metadata: {}
@@ -147,17 +161,17 @@ require_paths:
147
161
  - lib
148
162
  required_ruby_version: !ruby/object:Gem::Requirement
149
163
  requirements:
150
- - - '>='
164
+ - - ">="
151
165
  - !ruby/object:Gem::Version
152
166
  version: '0'
153
167
  required_rubygems_version: !ruby/object:Gem::Requirement
154
168
  requirements:
155
- - - '>='
169
+ - - ">="
156
170
  - !ruby/object:Gem::Version
157
171
  version: '0'
158
172
  requirements: []
159
173
  rubyforge_project:
160
- rubygems_version: 2.0.14
174
+ rubygems_version: 2.4.0
161
175
  signing_key:
162
176
  specification_version: 4
163
177
  summary: Ransack and SimpleForm combined.