mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-19 14:26:14 -04:00
13 lines
370 B
Ruby
13 lines
370 B
Ruby
class Photographing < ActiveRecord::Base
|
|
belongs_to :photo
|
|
belongs_to :photographable, polymorphic: true
|
|
|
|
def self.item(item_id, item_type)
|
|
find_by!(photographable_id: item_id, photographable_type: item_type).photographable
|
|
end
|
|
|
|
def item
|
|
find_by!(photographable_id: photographable_id, photographable_type: photographable_type).photographable
|
|
end
|
|
end
|