Module: Mongoid::Markdown

Extended by:
ActiveSupport::Concern
Defined in:
lib/mongoid-markdown/mongoid_new.rb,
lib/mongoid-markdown/mongoid_old.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Instance Method Summary collapse

Instance Method Details

#markdown!Object



55
56
57
# File 'lib/mongoid-markdown/mongoid_new.rb', line 55

def markdown!
  self.class.markdown_attributes.each { |attr| __send__(attr) }
end

#marked_downObject



43
44
45
# File 'lib/mongoid-markdown/mongoid_new.rb', line 43

def marked_down
  marked_down? ? (@marked_down ||= {}) : @attributes.dup
end

#marked_down=(value) ⇒ Object



51
52
53
# File 'lib/mongoid-markdown/mongoid_new.rb', line 51

def marked_down=(value)
  @is_marked_down = !!value
end

#marked_down?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/mongoid-markdown/mongoid_new.rb', line 47

def marked_down?
  @is_marked_down != false
end

#reloadObject



59
60
61
62
# File 'lib/mongoid-markdown/mongoid_new.rb', line 59

def reload
  marked_down.clear
  super
end

#write_attribute(attr_name, value) ⇒ Object



64
65
66
67
# File 'lib/mongoid-markdown/mongoid_new.rb', line 64

def write_attribute(attr_name, value)
  marked_down[attr_name.to_s] = nil
  super
end