class MailchimpAPI::InterestCategory

Public Instance Methods

interests(params = {}) click to toggle source

The path to get interests is '/3.0/lists/:list_id/interest-categories/:interest_category_id' Unfortunately, ActiveResource does not support nested resources, only single parent resources:

github.com/rails/activeresource/blob/4accda8bc03ceae0ad626f8cec0b4751e89a58ad/lib/active_resource/associations.rb#L151

Using a has_many, there is no way to include the `list_id`, so we just create our own interests method.

# File lib/mailchimp_api/resources/interest_category.rb, line 21
def interests(params = {})
  @interests ||= MailchimpAPI::Interest.find(:all, params: { interest_category_id: id }.deep_merge(prefix_options).deep_merge(params))
end