Sha256: 98906de206ecfdf968598919c311d61ce0ff192e72f6f120f690308efd109fce

Contents?: true

Size: 659 Bytes

Versions: 7

Compression:

Stored size: 659 Bytes

Contents

module ConnectionManager
  module Associations
    @defined_associations
    
    # Stores defined associtions and their options
    def defined_associations
      @defined_associations ||= {}
    end
        
    def belongs_to(*options)
      defined_associations[:belongs_to] ||= []
      defined_associations[:belongs_to] << options
      super
    end
    
    def has_many(*options)
      defined_associations[:has_many] ||= []
      defined_associations[:has_many] << options
      super
    end
    
    def has_one(*options)
      defined_associations[:has_one] ||= []
      defined_associations[:has_one] << options
      super
    end   
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
connection_manager-0.2.6 lib/connection_manager/associations.rb
connection_manager-0.2.5 lib/connection_manager/associations.rb
connection_manager-0.2.4 lib/connection_manager/associations.rb
connection_manager-0.2.3 lib/connection_manager/associations.rb
connection_manager-0.2.2 lib/connection_manager/associations.rb
connection_manager-0.2.1 lib/connection_manager/associations.rb
connection_manager-0.2.0 lib/connection_manager/associations.rb