Sha256: 406cbe53155916fc2f251872244ba9d926cc49ec97fd04f6688fd67ac8d58ccd

Contents?: true

Size: 611 Bytes

Versions: 6

Compression:

Stored size: 611 Bytes

Contents

module Mongoid
  module Userstamps
    module Model
      extend ActiveSupport::Concern

      included do
        Mongoid::Userstamps::Config.add_model_class(self)
      end

      def userstamps_config
        self.class.userstamps_config
      end

      class_methods do
        def userstamps_model
          @userstamps_model ||= Mongoid::Userstamps::Config::Model.new(self)
        end

        def current_user
          userstamps_config.current_user(userstamps_model.user_model)
        end

        def userstamps_config
          Mongoid::Userstamps::Config
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mongoid-userstamps-3.1.3 lib/mongoid/userstamps/model.rb
mongoid-userstamps-3.1.2 lib/mongoid/userstamps/model.rb
mongoid-userstamps-3.1.1 lib/mongoid/userstamps/model.rb
mongoid-userstamps-3.1.0 lib/mongoid/userstamps/model.rb
mongoid-userstamps-3.0.0.alpha1 lib/mongoid/userstamps/model.rb
mongoid-userstamps-2.0.0 lib/mongoid/userstamps/model.rb