Changed order of photo association relationship declarations

This commit is contained in:
Brenda Wallace
2018-01-03 17:24:51 +13:00
parent 4917ab9ae8
commit d456d045cd

View File

@@ -2,8 +2,8 @@ module PhotoCapable
extend ActiveSupport::Concern
included do
has_many :photos, through: :photographings, as: :photographable
has_many :photographings, as: :photographable, dependent: :destroy
has_many :photos, through: :photographings, as: :photographable
scope :has_photos, -> { includes(:photos).where.not(photos: { id: nil }) }
end