Sha256: 487a5b179c1c2e4cee60b7f915321bc9af9ef6cf36d06071e4d92d743da44f46

Contents?: true

Size: 661 Bytes

Versions: 3

Compression:

Stored size: 661 Bytes

Contents

module Enjoy
  module Models
    module GalleryImage
      extend ActiveSupport::Concern
      include Enjoy::Model
      include Enjoy::Enableable

      module ClassMethods
        def gallery_class_name
          "Enjoy::Gallery"
        end

        def gallery_class
          gallery_class_name.constantize
        end
      end

      include Enjoy.orm_specific('GalleryImage')

      included do

        belongs_to :gallery, class_name: gallery_class_name
        field :name, type: String, localize: Enjoy.configuration.localize

        validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/, if: :image?
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
enjoy_cms-0.2.0.2 lib/enjoy/models/gallery_image.rb
enjoy_cms-0.2.0.1.beta lib/enjoy/models/gallery_image.rb
enjoy_cms-0.2.0.beta lib/enjoy/models/gallery_image.rb