Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
def self.find(*args) first_arg = args.first if first_arg && args.length == 1 if first_arg.is_a?(String) && first_arg.to_i.to_s != first_arg.to_s find_by_permalink(first_arg) else super end elsif first_arg && args.length == 2 if first_arg.is_a?(String) && first_arg.to_i.to_s != first_arg.to_s && args[1].is_a?(Hash) && args[1].keys.length == 1 && args[1].keys.first == :include find_by_permalink(first_arg, :include => args[1][:include]) else super end else super end end
This paste will be private.
From the Design Piracy series on my blog: