Sha256: 9ffcec9ecef3e9004b06c20c117ba69c683cb64240a4dcd217f9ca933bf5df65

Contents?: true

Size: 610 Bytes

Versions: 4

Compression:

Stored size: 610 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

4 entries across 4 versions & 1 rubygems

Version Path
mongoid-userstamps-3.4.1 lib/mongoid/userstamps/model.rb
mongoid-userstamps-3.4.0 lib/mongoid/userstamps/model.rb
mongoid-userstamps-3.3.0 lib/mongoid/userstamps/model.rb
mongoid-userstamps-3.2.1 lib/mongoid/userstamps/model.rb