Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
def browse if params[:year] and params[:month] and params[:day] browse_date = Date.new(params[:year], params[:month], params[:day]) else browse_date = Date.today end month_start = browse_date dates = (Event.find(:all, :conditions => ["starts_at > ?", month_start ]).map { |event| (event.starts_at.to_date..event.ends_at.to_date) }) @dates = dates.map { |range| Array(range) }.flatten end
From the Design Piracy series on my blog: