Created
August 6, 2011 04:32
-
-
Save whalec/1129014 to your computer and use it in GitHub Desktop.
Ruby Module implementation
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
module Attachments | |
def attachments | |
images.map do | |
{ | |
:id => id, | |
:styles => styles, | |
:endpoint => endpoint, | |
} | |
end | |
end | |
end | |
#Then in the model you want to use it in... include Attachments |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment