simple_form_extension 1.2.20 → 1.2.21

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: f7d4974ee71c785990804759ea8d876ba5a6a438
4
- data.tar.gz: 7635b712c21ea6a73e05de4f94e51afc5d4ebb2c
3
+ metadata.gz: e370539cbb41a3fadee1616fab1de6f18e4e72c1
4
+ data.tar.gz: a3e2e7f10511fd4bd99779e256f4f281365be79d
5
5
  SHA512:
6
- metadata.gz: 0a286f7b7053e0cfe64d096a69bc9d24bcf4dc59316d10acd8a11f15d0f12f54953cecba85d2bf19adc9ddb19dad499b6be9e628dbc8df3570c4461f8676c1c6
7
- data.tar.gz: 24bf49b3a78231b040f27e416ac87ed8843c67100768d1f964b363867edf3ac3a5cd59ce63f60a3c4de39733a9a62f3df73f60225457fd17eda0ba0f05807a2f
6
+ metadata.gz: 35be6562973b9c43412da2b3459b8b7e286f75919a313d55f5500ff56c4e241cd153197463e85510cd5daaa5435f3c2c9a107554a0b32993e9bbd3b894b4ab5a
7
+ data.tar.gz: 0669e178bcd964fbfeee69bec192eddc1b2a35e0e5f9717e01477ab0fbc1ad60160ecc6a4569c77a165da747a435d038d17411f7de01ee5b3681e6820f677d47
@@ -114,10 +114,10 @@ module SimpleFormExtension
114
114
  end
115
115
 
116
116
  def foreign_key
117
- @foreign_key ||= if reflection.macro == :has_many
118
- reflection.foreign_key.pluralize
119
- else
120
- reflection.foreign_key
117
+ @foreign_key ||= case reflection.macro
118
+ when :belongs_to then reflection.foreign_key
119
+ when :has_one then :"#{ reflection.name }_id"
120
+ when :has_many then :"#{ reflection.name.to_s.singularize }_ids"
121
121
  end
122
122
  end
123
123
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleFormExtension
2
- VERSION = "1.2.20"
2
+ VERSION = "1.2.21"
3
3
  end
@@ -1,5 +1,4 @@
1
1
  class Selectize
2
-
3
2
  selectizeDefaults: ->
4
3
  mode: if @single then 'single' else 'multi'
5
4
  maxItems: if @single then 1 else @$el.data('max-items')
@@ -15,9 +14,7 @@ class Selectize
15
14
 
16
15
  @$el.val('')
17
16
 
18
- @$el.selectize(
19
- $.extend @selectizeDefaults(), @options
20
- )
17
+ @$el.selectize($.extend @selectizeDefaults(), @options)
21
18
 
22
19
  if (value = @$el.data('value'))
23
20
  @initializeValue(value)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.20
4
+ version: 1.2.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Vasseur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-18 00:00:00.000000000 Z
11
+ date: 2015-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails