Skip to content

Instantly share code, notes, and snippets.

@sixtyfive
Created March 6, 2010 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sixtyfive/323785 to your computer and use it in GitHub Desktop.
Save sixtyfive/323785 to your computer and use it in GitHub Desktop.
class Week < ActiveRecord::Base
has_many :days
def activities
activities = []
days.each {|day| activities = activities | day.activities}
return activities
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment