app/models/quota.rb
def find_v1(user, params)
      raise InvalidQuotaFile.new("Quota file with version 1 formatting missing quotas array section") unless params["quotas"].respond_to?(:each)

      q = []
      params["quotas"].each do |quota|
        # If individual quota data points include a timestamp, use that instead of the global source timestamp
        if quota.key?("timestamp")
          time = quota["timestamp"]
        else
          time = params["timestamp"]
        end
        q += create_both_quota_types(quota.merge "updated_at" => time) if !user || user == quota["user"]
      end
      q
    end
# Parse JSON object using version 1 formatting
Parse JSON object using version 1 formatting
Parse JSON object using version 1 formatting
def find_v1(user, params)
      raise InvalidQuotaFile.new("Quota file with version 1 formatting missing quotas array section") unless params["quotas"].respond_to?(:each)
      q = []
      params["quotas"].each do |quota|
        if quota.key?("timestamp")
          time = quota["timestamp"]
        else
          time = params["timestamp"]
        end
        q += create_both_quota_types(quota.merge "updated_at" => time) if !user || user == quota["user"]
      end
      q
    end
def find_v1 ( user , params ) raise InvalidQuotaFile . new ( "Quota file with version 1 formatting missing quotas array section" ) unless params [ "quotas" ] . respond_to? ( :each ) q = [ ] params [ "quotas" ] . each do | quota | if quota . key? ( "timestamp" ) time = quota [ "timestamp" ] else time = params [ "timestamp" ] end q += create_both_quota_types ( quota . merge "updated_at" => time ) if ! user || user == quota [ "user" ] end q end
Parse JSON object using version 1 formatting
Parse JSON object using version 1 formatting
# If individual quota data points include a timestamp, use that instead of the global source timestamp
user
params