app/models/polymorphic/avatar.rb
# frozen_string_literal: true
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
# == Schema Information
#
# Table name: avatars
#
# id :integer not null, primary key
# user_id :integer
# entity_id :integer
# entity_type :string(255)
# image_file_size :integer
# image_file_name :string(255)
# image_content_type :string(255)
# created_at :datetime
# updated_at :datetime
#
class Avatar < ActiveRecord::Base
belongs_to :user
belongs_to :entity, polymorphic: true
has_one_attached :image
ActiveSupport.run_load_hooks(:fat_free_crm_avatar, self)
end