Created
January 26, 2011 13:13
Revisions
-
beanieboi revised this gist
Jan 26, 2011 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,4 +2,5 @@ def compare_to(version) reject_fields = ["_id", "updated_at", "version"] diff_array = self.versions[version-1].attributes.to_hash.to_a - self.attributes.to_hash.to_a diff_array.delete_if {|f| reject_fields.include?(f.first) } Hash[diff_array] end -
beanieboi created this gist
Jan 26, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ def compare_to(version) reject_fields = ["_id", "updated_at", "version"] diff_array = self.versions[version-1].attributes.to_hash.to_a - self.attributes.to_hash.to_a diff_array.delete_if {|f| reject_fields.include?(f.first) } end