lib/ProMotion/styling/styling.rb in ProMotion-2.0.1 vs lib/ProMotion/styling/styling.rb in ProMotion-2.1.0.beta1
- old
+ new
@@ -16,12 +16,14 @@
set_attributes(sub_element, v) if sub_element
elsif element.respond_to?("#{k}=")
element.send("#{k}=", v)
elsif v.is_a?(Array) && element.respond_to?("#{k}") && element.method("#{k}").arity == v.length
element.send("#{k}", *v)
- else
- # Doesn't respond. Check if snake case.
- set_attribute(element, camelize(k), v) if k.to_s.include?("_")
+ elsif k.to_s.include?("_") # Snake case?
+ set_attribute(element, camelize(k), v)
+ else # Warn
+ PM.logger.debug "set_attribute: #{element.inspect} does not respond to #{k}=."
+ PM.logger.log("BACKTRACE", caller(0).join("\n"), :default) if PM.logger.level == :verbose
end
element
end
def content_max(view, mode = :height)