Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:4570992
1 2 3 4 5 6 7 8 9 10 11 12 13
require 'mongoid'
 
class Item; include Mongoid::Document; end
 
def clean_object(obj)
obj.instance_variables.each do |ivar|
obj.send(:remove_instance_variable, ivar) unless ivar == :@attributes
end
end
 
item = Item.new
clean_object(Item.new)
item.instance_variables # => [:@attributes]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.