lib/medea/jasonlistproperty.rb in medea-0.7.1 vs lib/medea/jasonlistproperty.rb in medea-0.7.2

- old
+ new

@@ -14,10 +14,14 @@ :HTTP_X_ACTION => :POST}} self.filters[:FILTER][:HTTP_X_CLASS] = list_class.name if list_type == :value @list_name = list_name @parent = parent + if @parent.is_a? JasonObject + self.filters[:FILTER][:HTTP_X_PARENT] = @parent.jason_key + end + @state = :prefetch @contents = [] @list_type = list_type end @@ -116,25 +120,20 @@ super content end def to_url - url = "#{JasonDB::db_auth_url}@#{@time_limit}.#{@result_format}?" - params = ["VERSION0"] - params << "FILTER=HTTP_X_LIST:#{@list_name.to_s}" - - if @parent.is_a? JasonObject - params << "FILTER=HTTP_X_PARENT:#{@parent.jason_key}" - else # @parent.is_a? JasonListProperty ##(or DeferredQuery?) + if not @parent.is_a? JasonObject + # @parent.is_a? JasonListProperty ##(or DeferredQuery?) #we can get the insecure url here, because it will be resolved and executed at JasonDB - on a secure subnet. #puts " = Fetching subquery stupidly. (#{@parent.to_url})" @parent.result_format = :keylist subquery = (RestClient.get @parent.to_url).strip - #puts " = Result: #{subquery}" - params << "FILTER={HTTP_X_PARENT:#{subquery}}" + + self.filters[:FILTER][:HTTP_X_PARENT] = subquery.split "," end - url << URI.escape(params.join("&"), Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")) + super end end end \ No newline at end of file