Skip to content

Instantly share code, notes, and snippets.

@thiagoa
Created December 19, 2016 13:35
Show Gist options
  • Save thiagoa/843eaa065570d049c816149c1897c1bc to your computer and use it in GitHub Desktop.
Save thiagoa/843eaa065570d049c816149c1897c1bc to your computer and use it in GitHub Desktop.
class Project
include Imageable.new(has_one: %i(main_image secondary_image))
end
project = Project.new
project.main_image #=> <Image kind="main_image" imageable_type="Project">
project.secondary_image #=> <Image kind="secondary_image" imageable_type="Project">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment