Sha256: 8718fde90df05900777c6125da6ecc1be00b1ef99b68dc47d1ea20bc69edf33d

Contents?: true

Size: 497 Bytes

Versions: 8

Compression:

Stored size: 497 Bytes

Contents

module Adminpanel
  class <%= class_name %> < ActiveRecord::Base
    include Adminpanel::Base
    # include Adminpanel::SortableGallery

    belongs_to :<%= reference_name %>

    mount_uploader :file, <%= class_name %>Uploader

    before_destroy :remove_attachment

    # def self.relation_field
    #   '<%= reference_name %>_id'
    # end

    # def self.display_name
    #   '<%= class_name %>'
    # end

    private
      def remove_attachment
        self.remove_file!
      end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
adminpanel-2.6.1 lib/generators/adminpanel/gallery/templates/gallery_template.rb
adminpanel-2.6.0 lib/generators/adminpanel/gallery/templates/gallery_template.rb
adminpanel-2.5.5 lib/generators/adminpanel/gallery/templates/gallery_template.rb
adminpanel-2.5.4 lib/generators/adminpanel/gallery/templates/gallery_template.rb
adminpanel-2.5.3 lib/generators/adminpanel/gallery/templates/gallery_template.rb
adminpanel-2.5.2 lib/generators/adminpanel/gallery/templates/gallery_template.rb
adminpanel-2.5.1 lib/generators/adminpanel/gallery/templates/gallery_template.rb
adminpanel-2.5.0 lib/generators/adminpanel/gallery/templates/gallery_template.rb