dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Fix for edgecase with magic attributes

Open pnomolos opened this issue 4 years ago • 0 comments

If you had a dragonfly accessor such as photo (with the associated photo_uid column) but did not have a photo_size column, the defining a method such as thumbnail_photo_size would include :size in the magic_attributes accessor for that model - even though one didn't actually exist.

Ex:

class User
  dragonfly_accessor :photo

  def thumbnail_photo_size
    # The inclusion of this method causes Dragonfly to think this class has a photo_size column
  end
end

pnomolos avatar Jun 30 '21 04:06 pnomolos