Created
August 24, 2012 15:42
-
-
Save almonk/3452124 to your computer and use it in GitHub Desktop.
This file contains 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
def next | |
project.images.first(:conditions => ["position > ?", position], :order => "position asc") | |
end | |
def prev | |
project.images.last(:conditions => ["position < ?", position], :order => "position desc") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment