Sha256: 9dea1ed666f7619a95bf2c6c03426c43a5bd701b1d4fd9a1183ea09f528256af
Contents?: true
Size: 526 Bytes
Versions: 21
Compression:
Stored size: 526 Bytes
Contents
module ApiResource module AssociationActivation extend ActiveSupport::Concern included do class_attribute :association_types # our default association types self.association_types = {:belongs_to => :single, :has_one => :single, :has_many => :multi} 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
21 entries across 21 versions & 1 rubygems