Sha256: 6ffe513e3a41c0d89f16fcf9a1d28efd55f1f88a72eedb5a298ef5d39e681a92
Contents?: true
Size: 589 Bytes
Versions: 22
Compression:
Stored size: 589 Bytes
Contents
module ApiResource module AssociationActivation extend ActiveSupport::Concern included do class_attribute :association_types # our default association types self.association_types = { :belongs_to => :belongs_to_remote, :has_one => :has_one_remote, :has_many => :has_many_remote } end module ClassMethods def activate_associations(assoc_types = nil) self.association_types = assoc_types unless assoc_types.nil? self.send(:include, ApiResource::Associations) end end end end
Version data entries
22 entries across 22 versions & 1 rubygems