Sha256: 2d7802d5b3d2afb5c93efa185f13fab8ad80864436fe4c94d7a113b9ea4d7c96

Contents?: true

Size: 631 Bytes

Versions: 1

Compression:

Stored size: 631 Bytes

Contents

module ActiveRecord
  module QueryMethods
    extend ActiveSupport::Concern

    def extending!(*modules, &block)

      modules << Module.new(&block) if block
      modules.flatten!
      self.extending_values += modules
      extend(*extending_values) if extending_values.any?
      self
    end

    def none
      where("1=0").extending(ActiveRecord::NullRelation)
    end

  end
end

module RailsBackward
  module QueryMethods
    extend ActiveSupport::Concern

    included do
      class << self
        delegate :none, to: :scoped
      end
    end
  end
end

ActiveRecord::Base.send(:include, RailsBackward::QueryMethods)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_backward-0.0.2 lib/rails_backward/relation.rb