Sha256: 7e5a355ea6e2b6a2ce56a17732d976f0524885ff5afb66931a60e8217aa1d5f5

Contents?: true

Size: 483 Bytes

Versions: 23

Compression:

Stored size: 483 Bytes

Contents

# encoding: UTF-8
module MongoMapper
  module Plugins
    module Userstamps
      extend ActiveSupport::Concern

      module ClassMethods
        def userstamps!(options = {})
          class_name = (options[:class_name] || options[:class] || 'User' ).to_s
          key :creator_id, ObjectId
          key :updater_id, ObjectId
          belongs_to :creator, :class_name => class_name
          belongs_to :updater, :class_name => class_name
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 3 rubygems

Version Path
mongo_mapper-0.16.0 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.15.6 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.15.5 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.15.4 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.15.3 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.15.2 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.15.1 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.15.0 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.14.0 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.14.0.rc1 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.13.1 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.13.0 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.13.0.beta2 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.13.0.beta1 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.12.0 lib/mongo_mapper/plugins/userstamps.rb
lookout-mongo_mapper-0.11.3 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.11.2 lib/mongo_mapper/plugins/userstamps.rb
jamieorc-mongo_mapper-0.11.1.1 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.11.1 lib/mongo_mapper/plugins/userstamps.rb
mongo_mapper-0.11.0 lib/mongo_mapper/plugins/userstamps.rb