Created
February 20, 2010 20:43
-
-
Save pyrat/309896 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
def get_artist | |
Artist.find params[:artist_id] | |
end | |
def get_label | |
Label.find params[:label_id] | |
end | |
def parent_object | |
if params[:artist_id] | |
@parent = get_artist | |
@mode = 'artist' | |
elsif params[:label_id] | |
@parent = get_label | |
@mode = 'label' | |
else | |
raise StandardError, "Unable to get parent object." | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment