diff --git a/README.md b/README.md index 3a93980..5a4ef52 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Mongoid::Userstamp does the following: # Example user class class MyUser include Mongoid::Document - include Mongoid::Userstamp::User + include Mongoid::Userstamp::UserstampUser # optional class-level config override # mongoid_userstamp_user reader: :current_my_user @@ -127,14 +127,14 @@ Please note that each model may subscribe to only one user type for its userstam ```ruby class Admin include Mongoid::Document - include Mongoid::Userstamp::User + include Mongoid::Userstamp::UserstampUser mongoid_userstamp_user reader: :current_admin end class Customer include Mongoid::Document - include Mongoid::Userstamp::User + include Mongoid::Userstamp::UserstampUser mongoid_userstamp_user reader: :current_customer end diff --git a/lib/mongoid/userstamp/config/gem_config.rb b/lib/mongoid/userstamp/config/gem_config.rb index 09d17ef..05b4ca4 100644 --- a/lib/mongoid/userstamp/config/gem_config.rb +++ b/lib/mongoid/userstamp/config/gem_config.rb @@ -19,7 +19,7 @@ def initialize(&block) # @deprecated def user_model=(value) - warn 'Mongoid::Userstamp `user_model` config is removed as of v0.4.0. If using a model named other than `User`, please include `Mongoid::Userstamp::User` in your user model instead.' + warn 'Mongoid::Userstamp `user_model` config is removed as of v0.4.0. If using a model named other than `User`, please include `Mongoid::Userstamp::UserstampUser` in your user model instead.' end # @deprecated diff --git a/lib/mongoid/userstamp/mixins/user.rb b/lib/mongoid/userstamp/mixins/user.rb index cdcda34..680bf49 100644 --- a/lib/mongoid/userstamp/mixins/user.rb +++ b/lib/mongoid/userstamp/mixins/user.rb @@ -3,7 +3,7 @@ module Mongoid module Userstamp - module User + module UserstampUser extend ActiveSupport::Concern diff --git a/lib/mongoid/userstamp/railtie.rb b/lib/mongoid/userstamp/railtie.rb index 2f821e8..64fdc33 100644 --- a/lib/mongoid/userstamp/railtie.rb +++ b/lib/mongoid/userstamp/railtie.rb @@ -5,11 +5,11 @@ module Userstamp class Railtie < Rails::Railtie - # Include Mongoid::Userstamp::User into User class, if not already done + # Include Mongoid::Userstamp::UserstampUser into User class, if not already done config.to_prepare do Mongoid::Userstamp.user_classes.each do |user_class| - unless user_class.included_modules.include?(Mongoid::Userstamp::User) - user_class.send(:include, Mongoid::Userstamp::User) + unless user_class.included_modules.include?(Mongoid::Userstamp::UserstampUser) + user_class.send(:include, Mongoid::Userstamp::UserstampUser) end end end diff --git a/spec/support/admin.rb b/spec/support/admin.rb index 5789a25..ee14236 100644 --- a/spec/support/admin.rb +++ b/spec/support/admin.rb @@ -1,7 +1,7 @@ # -*- encoding : utf-8 -*- class Admin include Mongoid::Document - include Mongoid::Userstamp::User + include Mongoid::Userstamp::UserstampUser field :name end \ No newline at end of file diff --git a/spec/support/user.rb b/spec/support/user.rb index 43cf3f3..2fb65d2 100644 --- a/spec/support/user.rb +++ b/spec/support/user.rb @@ -1,7 +1,7 @@ # -*- encoding : utf-8 -*- class User include Mongoid::Document - include Mongoid::Userstamp::User + include Mongoid::Userstamp::UserstampUser field :name end diff --git a/spec/unit/user_spec.rb b/spec/unit/user_spec.rb index 64ae267..237fd03 100644 --- a/spec/unit/user_spec.rb +++ b/spec/unit/user_spec.rb @@ -1,7 +1,7 @@ # -*- encoding : utf-8 -*- require 'spec_helper' -describe Mongoid::Userstamp::User do +describe Mongoid::Userstamp::UserstampUser do subject(:book) { Book.new(name: 'Crafting Rails Applications') } subject(:post) { Post.new(title: 'Understanding Rails') }