Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/subscriptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@

# Cancel a delayed product change
subscription.cancel_delayed_product_change

# List most recent 50 allocations for a subscription's component
subscription.component(12345).allocations
5 changes: 5 additions & 0 deletions lib/chargify_api_ares/resources/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ class Component < Base
def id
self.component_id
end

def allocations(params = {})
params.merge!({:subscription_id => self.prefix_options[:subscription_id], :component_id => self.component_id})
Allocation.find(:all, :params => params)
end
end

class Event < Base
Expand Down