lib/clevic/sampler.rb in clevic-0.13.0.b6 vs lib/clevic/sampler.rb in clevic-0.13.0.b9
- old
+ new
@@ -40,11 +40,11 @@
if set.is_a?( Hash )
set.values
else
set
end. \
- max{|a,b| a.to_s.length <=> b.to_s.length }.upcase
+ max{|a,b| a.to_s.length <=> b.to_s.length }.to_s.upcase
else
# choose samples based on the type of the field
case meta.type
when :boolean
field.label
@@ -63,11 +63,11 @@
when :many_to_one
related_sample
else
- if meta.type != NilClass
- raise "Sampler#compute can't figure out sample for #{entity_class.name}.#{field_name} because it's a #{meta.type.inspect}"
+ unless meta.type.nil?
+ raise "Sampler#compute can't figure out sample for #{entity_class.name}##{field_name} because it's a #{meta.type.inspect}"
end
end
end
end