Fix Style/Not cop violations

This commit is contained in:
Robert Speicher 2015-06-22 14:52:41 -04:00
parent 0716a559b5
commit 4dbf118a16

View file

@ -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);")