camaraderie icon indicating copy to clipboard operation
camaraderie copied to clipboard

acts_as_membership options

Open simonprev opened this issue 9 years ago • 0 comments

When we use acts_as_membership we should be able to declare options that will be appended to the belongs_to association. Like this example:

class Membership < ActiveRecord::Base
   # Camaraderie
   acts_as_membership
   # NOTE: This association is defined by the `acts_as_membership` method above.
   # However, we need to redefine it because we add `counter_cache`.
   belongs_to :organization, class_name: Camaraderie.organization_class, inverse_of: :memberships, counter_cache: true
end

simonprev avatar Jun 10 '15 14:06 simonprev