Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
ActiveRecord::Base.class_eval do def method_missing_with_update(method, *args, &block) return method_missing_without_update(method, *args, &block) unless method.to_s =~ /^update_[^(attribute)]/ method.to_s.sub(/^update_/, '').split('_and_').each do |attribute| update_attribute(attribute, args.shift) end end alias_method_chain :method_missing, :update end
This paste will be private.
From the Design Piracy series on my blog: