Fix Style/Not cop violations
This commit is contained in:
parent
0716a559b5
commit
4dbf118a16
1 changed files with 2 additions and 2 deletions
|
@ -12,9 +12,9 @@
|
|||
|
||||
module Select2Helper
|
||||
def select2(value, options={})
|
||||
raise "Must pass a hash containing 'from'" if not options.is_a?(Hash) or not options.has_key?(:from)
|
||||
raise ArgumentError, 'options must be a Hash' unless options.kind_of?(Hash)
|
||||
|
||||
selector = options[:from]
|
||||
selector = options.fetch(:from)
|
||||
|
||||
if options[:multiple]
|
||||
execute_script("$('#{selector}').select2('val', ['#{value}'], true);")
|
||||
|
|
Loading…
Reference in a new issue