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

Version Path
api_resource-0.6.3 lib/api_resource/association_activation.rb
api_resource-0.6.2 lib/api_resource/association_activation.rb
api_resource-0.6.1 lib/api_resource/association_activation.rb
api_resource-0.6.0 lib/api_resource/association_activation.rb
api_resource-0.5.1 lib/api_resource/association_activation.rb
api_resource-0.5.0 lib/api_resource/association_activation.rb
api_resource-0.4.3 lib/api_resource/association_activation.rb
api_resource-0.4.2 lib/api_resource/association_activation.rb
api_resource-0.4.0 lib/api_resource/association_activation.rb
api_resource-0.3.14 lib/api_resource/association_activation.rb
api_resource-0.3.13 lib/api_resource/association_activation.rb
api_resource-0.3.12 lib/api_resource/association_activation.rb
api_resource-0.3.11 lib/api_resource/association_activation.rb
api_resource-0.3.10 lib/api_resource/association_activation.rb
api_resource-0.3.8 lib/api_resource/association_activation.rb
api_resource-0.3.7 lib/api_resource/association_activation.rb
api_resource-0.3.6 lib/api_resource/association_activation.rb
api_resource-0.3.5 lib/api_resource/association_activation.rb
api_resource-0.3.4 lib/api_resource/association_activation.rb
api_resource-0.3.3 lib/api_resource/association_activation.rb