From: Nasir Khan Date: 2007-07-25T14:28:58+09:00 Subject: Refinement to facets/more/snapshot.rb ------=_Part_136936_21310544.1185341341591 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Suggestion for facets library snapshot.rb Consider adding optional fields argument to both take_snapshot() and restore_snapshot() to selectively take snapshot of selected fields as against all fields which is the default. Patch provided below over 1.8.54 : methods changes take_snapshot and restore_snapshot for Object only. # = snapshot.rb class Object def take_snapshot(fields=nil) snap = Hash.new fields = instance_variables unless fields fields.each do |iv| snap[iv] = instance_variable_get(iv) end snap end def restore_snapshot(snap, fields=nil) fields = instance_variables unless fields fields.each do |iv| instance_variable_set(iv, snap[iv]) end end end - nasir ------=_Part_136936_21310544.1185341341591--