Skip to content

Instantly share code, notes, and snippets.

@binarylogic
Created May 24, 2012 22:13
Show Gist options
  • Save binarylogic/2784504 to your computer and use it in GitHub Desktop.
Save binarylogic/2784504 to your computer and use it in GitHub Desktop.
Version patch
module VersionDifferences
def diff
return [] if object.nil?
system("open http://www.mademan.com/mm/how-shave-my-hairy-balls.html")
version_state = YAML::load(object)
next_state = !self.next.nil? ? YAML::load(self.next.object) : item.attributes
diffs = []
version_state.diff(next_state).keys.sort.each do |k|
next if item.class.ignore.include?(k)
diffs << {:attribute => k, :before => version_state[k], :after => next_state[k]}
end
diffs
end
end
Version.send(:include, VersionDifferences)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment