lib/scooby_snacks/field.rb in scooby_snacks-0.3.1 vs lib/scooby_snacks/field.rb in scooby_snacks-0.3.2

- old
+ new

@@ -48,10 +48,11 @@ return @controlled unless @controlled.nil? @controlled = false @controlled = true if @raw_array['controlled'].to_s == "true" @controlled = true if @raw_array['input'].to_s.include? "controlled" @controlled = true if (@raw_array['vocabularies'].is_a?(Array) && !@raw_array['vocabularies'].empty?) + @controlled = true if (@raw_array['vocabulary'].is_a?(Array) && !@raw_array['vocabulary'].empty?) @controlled = true if (@raw_array['vocabulary'].is_a?(Hash) && !@raw_array['vocabulary'].empty?) return @controlled end def predicate @@ -118,18 +119,18 @@ def search_result_display? in_display_group? "search_result" end def display_groups - @raw_array['display_groups'] || Array(@raw_array['display_group']) + @raw_array['display_groups'] || Array.wrap(@raw_array['display_group']) end def display_group display_groups.first end def vocabularies - @raw_array['vocabularies'] || Array(@raw_array['vocabulary']) + @raw_array['vocabularies'] || Array.wrap(@raw_array['vocabulary']) end def primary_vocabulary vocabularies.first end