Sha256: 1b648141d0fba6dd09107cd2ccf4a5786abdaf7fc45cff81695fea5bd83f05ed

Contents?: true

Size: 313 Bytes

Versions: 6

Compression:

Stored size: 313 Bytes

Contents

module Mongoid
  module Report

    ReportProxy = Struct.new(:context, :name) do
      def attach_to(model, options = {}, &block)
        as = options.fetch(:as) { model.collection.name }

        options.merge!(as: "#{name}-#{as}")

        context.attach_to(model, options, &block)
      end
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mongoid-report-0.1.9 lib/mongoid/report/report_proxy.rb
mongoid-report-0.1.7 lib/mongoid/report/report_proxy.rb
mongoid-report-0.1.6 lib/mongoid/report/report_proxy.rb
mongoid-report-0.1.5 lib/mongoid/report/report_proxy.rb
mongoid-report-0.1.3 lib/mongoid/report/report_proxy.rb
mongoid-report-0.1.2 lib/mongoid/report/report_proxy.rb