lib/gooddata/mixins/md_object_indexer.rb in gooddata-0.6.16 vs lib/gooddata/mixins/md_object_indexer.rb in gooddata-0.6.17

- old
+ new

@@ -25,12 +25,12 @@ fail(NoProjectError, 'Connect to a project before searching for an object') unless project return all(options) if id == :all return id if id.is_a?(MdObject) uri = if id.is_a?(Integer) || id =~ /^\d+$/ "#{project.md[MD_OBJ_CTG]}/#{id}" - elsif id !~ /\// + elsif id !~ %r{/} identifier_to_uri options, id - elsif id =~ /^\// + elsif id =~ %r{^/} id else fail 'Unexpected object id format: expected numeric ID, identifier with no slashes or an URI starting with a slash' end # new(GoodData.get uri) unless uri.nil?