Created
November 22, 2010 16:27
-
-
Save outworlder/710207 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (define-syntax has-many | |
| (syntax-rules (foreign-key:) | |
| ([_ parent child method-name foreign-key: column-name] | |
| (define-method (method-name (model parent)) | |
| (find-all-by-id child (slot-value model (quote column-name))))))) | |
| (has-many <planet-schematics> <planet-schematics-typemap> typemaps foreign-key: schematicID) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment