Class: Mongoid::History::Options
- Inherits:
-
Object
- Object
- Mongoid::History::Options
- Defined in:
- lib/mongoid/history/options.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#trackable ⇒ Object
readonly
Returns the value of attribute trackable.
Instance Method Summary collapse
-
#initialize(trackable, opts = {}) ⇒ Options
constructor
A new instance of Options.
- #prepared ⇒ Object
- #scope ⇒ Object
Constructor Details
#initialize(trackable, opts = {}) ⇒ Options
Returns a new instance of Options.
6 7 8 9 |
# File 'lib/mongoid/history/options.rb', line 6 def initialize(trackable, opts = {}) @trackable = trackable @options = .merge(opts) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/mongoid/history/options.rb', line 4 def @options end |
#trackable ⇒ Object (readonly)
Returns the value of attribute trackable.
4 5 6 |
# File 'lib/mongoid/history/options.rb', line 4 def trackable @trackable end |
Instance Method Details
#prepared ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/mongoid/history/options.rb', line 15 def prepared return @prepared if @prepared @prepared = .dup prepare_skipped_fields prepare_formatted_fields parse_tracked_fields_and_relations @prepared end |
#scope ⇒ Object
11 12 13 |
# File 'lib/mongoid/history/options.rb', line 11 def scope trackable.collection_name.to_s.singularize.to_sym end |