Class: Mongoid::Userstamp::GemConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/mongoid/userstamp/config/gem_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ GemConfig

Returns a new instance of GemConfig.



12
13
14
15
16
17
18
# File 'lib/mongoid/userstamp/config/gem_config.rb', line 12

def initialize(&block)
  @created_name = :created_by
  @updated_name = :updated_by
  @user_reader  = :current_user

  instance_eval(&block) if block_given?
end

Instance Attribute Details

#created_nameObject

Returns the value of attribute created_name.



8
9
10
# File 'lib/mongoid/userstamp/config/gem_config.rb', line 8

def created_name
  @created_name
end

#updated_nameObject

Returns the value of attribute updated_name.



9
10
11
# File 'lib/mongoid/userstamp/config/gem_config.rb', line 9

def updated_name
  @updated_name
end

#user_readerObject

Returns the value of attribute user_reader.



10
11
12
# File 'lib/mongoid/userstamp/config/gem_config.rb', line 10

def user_reader
  @user_reader
end

Instance Method Details

#created_column=(value) ⇒ Object

Deprecated.


26
27
28
29
# File 'lib/mongoid/userstamp/config/gem_config.rb', line 26

def created_column=(value)
  warn 'Mongoid::Userstamp `created_column` is deprecated as of v0.4.0. Please use `created_name` instead.'
  @created_name = value
end

#updated_column=(value) ⇒ Object

Deprecated.


32
33
34
35
# File 'lib/mongoid/userstamp/config/gem_config.rb', line 32

def updated_column=(value)
  warn 'Mongoid::Userstamp `created_column` is deprecated as of v0.4.0. Please use `created_name` instead.'
  @updated_name = value
end

#user_model=(value) ⇒ Object

Deprecated.


21
22
23
# File 'lib/mongoid/userstamp/config/gem_config.rb', line 21

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.'
end