Skip to content

Instantly share code, notes, and snippets.

@stephank
Created August 22, 2010 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stephank/544175 to your computer and use it in GitHub Desktop.
Save stephank/544175 to your computer and use it in GitHub Desktop.
class Model
# Method used in a class context.
@has_many = (names) ->
# Define the accessor method.
@[names] = ->
# Retrieve stuff from table 'names'
class Account extends Model
@has_many 'emails'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment