app/helpers/carload/application_helper.rb in carload-0.5.1 vs app/helpers/carload/application_helper.rb in carload-0.5.2
- old
+ new
@@ -14,11 +14,11 @@
return reflection.name if attribute_name =~ /#{reflection.name}/ and reflection.options[:polymorphic]
end
false
end
- def image? attribute_name
- attribute_name.to_s =~ /image|logo|img/
+ def image? model_name, attribute_name
+ attribute_name.to_s =~ /image|logo|img/ or (Dashboard.model(model_name).attributes.images.include? attribute_name.to_sym rescue nil)
end
def associated_model_name model_name, attribute_name
x = attribute_name.gsub(/_ids?$/, '').to_sym
Dashboard.model(model_name).associations.each do |name, association|