Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
module ActiveRecord class Base def clone_from(model) model.attributes.each {|attr, value| eval("self.#{attr}= model.#{attr}")} end end end # example! foo = Foo.new foo.clone_from(Bar.find(:first)) # it works! it's awesome!
This paste will be private.
From the Design Piracy series on my blog: