Resource: set version to nil if version is null

Is this the right fix? This fixes version cascading from the parent.
This commit is contained in:
Misty De Meo 2016-11-03 16:52:40 -07:00
parent d32a1c4c7d
commit 4e3d23ad14

View File

@ -145,7 +145,10 @@ class Resource
end
def version(val = nil)
@version ||= detect_version(val)
@version ||= begin
version = detect_version(val)
version.null? ? nil : version
end
end
def mirror(val)
@ -155,7 +158,7 @@ class Resource
private
def detect_version(val)
return if val.nil? && url.nil?
return Version::NULL if val.nil? && url.nil?
case val
when nil then Version.detect(url, specs)