Module: Diffing
- Defined in:
- lib/drafter/diffing.rb
Instance Method Summary collapse
-
#differences(attr, options = {:format => :html}) ⇒ String
Get a diff between the current and draft status of an ActiveRecord object field.
Instance Method Details
#differences(attr, options = {:format => :html}) ⇒ String
Get a diff between the current and draft status of an ActiveRecord object field.
10 11 12 13 14 |
# File 'lib/drafter/diffing.rb', line 10 def differences(attr, ={:format => :html}) if self.draft Diffy::Diff.new(self.send(attr), self.draft.send(attr)).to_s([:format]) end end |