volt-chosen 0.1.1 → 0.1.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: 488fcf2c470d85c095f0f62bb3dec381be2a5d64
4
- data.tar.gz: a5d79a8a11b74e84e159449ea42752114dbfdf5c
3
+ metadata.gz: 06d35b13d5619054f8dbf8af14955776265e4768
4
+ data.tar.gz: d1a4220f48199238cc2aed9d425e0c5050be4b2e
5
5
  SHA512:
6
- metadata.gz: 03602c3e58d476ce50e390fbac1a13ab10bed81168361a5bfe762cd75a6a96b445660c59dc0106b45d0f9acab39390136d72c5a5849a950aa171e11bf725b36a
7
- data.tar.gz: 7502c53ced5a29a0041637b5da303d65a6e39fc0066f858563021b4bc9deeadaf8e3f1dd2c7ca001acfd8e564eab050fa658517783fb92f2bdaa451567e480da
6
+ metadata.gz: f0f6dc7bb6e3cab817103e557f672630c110ae02a84ec9c086e2e844bdd269ff7a9fd792089b7a1cee3937319b509749b4f14f951976baf6efecf36a355ef3fe
7
+ data.tar.gz: 9178bd07bc7828f74a55e7e5d4792271f54ae64e6aad7b1130081d54cc01763ceba0a3949a79e4d74d118477ce5f03d805e182bae8a0b4223c8a03c91cd71175
@@ -10,22 +10,21 @@ module Chosen
10
10
  reactive_accessor :options
11
11
 
12
12
  def setup_field
13
- # Default to text fields
14
- if attrs.respond_to?(:type)
15
- @type = attrs.type
16
- else
17
- @type = 'text'
18
- end
19
-
20
13
  unless attrs.value_last_method
21
14
  field_type = self.class.to_s.underscore.gsub(/[_]Controller$/, '')
22
- raise "a <:fields:#{field_type} tag was used without passing a value attribute"
15
+ raise "a <:chosen tag was used without passing a value attribute"
23
16
  end
24
17
 
25
18
  # Get the name of the field by looking at the method scope
26
19
  @field_name = attrs.value_last_method.gsub(/^[_]/, '')
27
20
  end
28
21
 
22
+ # Set the model to attrs.options so that we don't render the view until
23
+ # the promise passed to attrs.options resolves.
24
+ def index
25
+ self.model = attrs.options
26
+ end
27
+
29
28
  # Currently catches the 'change' event and re-raises it as chosen:changed due
30
29
  # to a framework conflict that was throwing an error.
31
30
  # See related issue:
@@ -1,5 +1,5 @@
1
1
  module Volt
2
2
  module Chosen
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volt-chosen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Hale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-07 00:00:00.000000000 Z
11
+ date: 2016-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: volt
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  version: '0'
257
257
  requirements: []
258
258
  rubyforge_project:
259
- rubygems_version: 2.4.8
259
+ rubygems_version: 2.4.5.1
260
260
  signing_key:
261
261
  specification_version: 4
262
262
  summary: Volt bindings for Chosen, the JS library for making long, unwieldy select
@@ -280,4 +280,3 @@ test_files:
280
280
  - spec/integration/sample_integration_spec.rb
281
281
  - spec/sample_spec.rb
282
282
  - spec/spec_helper.rb
283
- has_rdoc: