3 Replies Latest reply on Feb 7, 2014 10:12 AM by Graham Bird

    Possible Issue with PropertyBag Find conditions

    Graham Bird

      There may be an issue with the "or" clause when searching a property bag collection or I may have written the clause incorrectly.

      The intention is that I want the query to check if there are any Locations that have the status of ARRIVED_AT_PICKUP or ARRIVED_AT_DESTINATION.

      The two status values are set as "3" and "6" in the LocationStatus module (just in case this is relevant).

      I am seeing the error message recorded in my logs despite the fact I would expect to never hit it.

       

      if Location.find(:all, :conditions => {:CurrentStatusID => LocationStatus::ARRIVED_AT_DESTINATION, :CurrentStatusID => LocationStatus::ARRIVED_AT_PICKUP}, :op => 'OR').any?
        return true
      end
      if Location.find(:all, :conditions => {:CurrentStatusID => LocationStatus::ARRIVED_AT_DESTINATION}).any?
        RhoLog.error('ERROR', 'Failed to pick up the ARRIVED_AT_DESTINATION items in main clause')
        return true
      end

       

      Any insight into why this is occurring would be appreciated or if it is a bug then it should be addressed.

       

      Kind regards,

      Graham Bird.