Sha256: d0d946a38c65e3adad91e7490a2b2f9b39d049709b3536bb33befa426803c87f

Contents?: true

Size: 505 Bytes

Versions: 3

Compression:

Stored size: 505 Bytes

Contents

module GroupedScope
  module Arish
    module Associations
      module CollectionAssociation

        extend ActiveSupport::Concern

        def association_scope
          if reflection.grouped_scope?
            @association_scope ||= Associations::AssociationScope.new(self).scope if klass
          else
            super
          end
        end

      end
    end
  end
end

ActiveRecord::Associations::CollectionAssociation.send :include, GroupedScope::Arish::Associations::CollectionAssociation

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
grouped_scope-3.2.1 lib/grouped_scope/arish/associations/collection_association.rb
grouped_scope-3.2.0 lib/grouped_scope/arish/associations/collection_association.rb
grouped_scope-3.1.2 lib/grouped_scope/arish/associations/collection_association.rb