Skip to content

Instantly share code, notes, and snippets.

@phillipoertel
Created May 27, 2014 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phillipoertel/a7589eee4d3953c0eff5 to your computer and use it in GitHub Desktop.
Save phillipoertel/a7589eee4d3953c0eff5 to your computer and use it in GitHub Desktop.
pi_images_refactoring.rb
class PortfolioItem
#
# alt
#
#has_attached_file :teaser, styles: { tile: ["555x>", :jpg] }
#
# neu
#
has_many :images
def uploaded_tile_image
images.find_by_type(:teaser)
end
def uploaded_tile_image=(new_image)
images.... = new_image
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment