53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/megam/core/billings_collection.rb', line 53
def insert(billings)
is_megam_billings(billings)
if @insert_after_idx
@billings.insert(@insert_after_idx + 1, billings)
@billings_by_name.each_key do |key|
@billings_by_name[key] += 1 if@billings_by_name[key] > @insert_after_idx
end
@billings_by_name[billings.repo_name] = @insert_after_idx + 1
@insert_after_idx += 1
else
@billings << billings
@billings_by_name[billings.repo_name] =@billings.length - 1
end
end
|