Sha256: 2a10c9ae90b9ec6c2e0f08668536e4bb688ee8678e3265d65a667eebc5cd505f

Contents?: true

Size: 336 Bytes

Versions: 2

Compression:

Stored size: 336 Bytes

Contents

module Hancock::Gallery::Gallerable
  extend ActiveSupport::Concern

  module ClassMethods
    def hancock_gallerable_field(name = :galleries, opts = {})
      class_name = opts.delete(:class_name)
      class_name ||= "Hancock::Gallery::Gallery"

      has_many name, as: :hancock_gallerable, class_name: class_name
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hancock_cms_gallery-1.0.2 app/models/concerns/hancock/gallery/gallerable.rb
hancock_cms_gallery-1.0.0 app/models/concerns/hancock/gallery/gallerable.rb