0

I'm trying to do a deploy to Amazon Lightsail server using Dokku. The configuration for deploy its working, but when I try to do the deploy I get the error:

/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/concern.rb:126:in `included': Cannot define multiple 'included' blocks for a Concern (ActiveSupport::Concern::MultipleIncludedBlocks)
        from /app/app/models/models/concerns/productable.rb:5:in `<module:Productable>'
        from /app/app/models/models/concerns/productable.rb:1:in `<top (required)>'

I try this, but did not solve my problem.

in the file mentioned I have this code:

module Productable

    extend ActiveSupport::Concern

    included do

        extend FriendlyId
        include PgSearch

        before_validation :update_slug, on: :update, prepend: true

        acts_as_paranoid

        has_one :highlight, as: :highlightable, dependent: :destroy

        scope :published, -> { joins(:teacher).where(status: PublishStatus::PUBLIC) }
        scope :draft, -> { where(status: PublishStatus::DRAFT) }
        scope :from_category_group, -> category_group { joins(category: :category_group).where("category_groups.slug = ?", category_group) }
        scope :from_category, -> category { joins(:category).where("categories.slug = ?", category) }
        scope :from_teacher, -> teacher_id { where(teacher_id: teacher_id) }        
        scope :highlighted, -> { joins(:highlight) } 

        pg_search_scope :search, 
            associated_against: {
                category_group: :name,
                category: :name,
                teacher: :name
            }, 
            against: [:title, :description, :keywords],
            ignoring: :accents,
            using: {
                tsearch: { prefix: true }
            }

    end

    def update_slug
        #force update slug only if title changed
        self.slug = nil if self.title_changed?          
    end

end

I do not have this problem when I deploy the application to Heroku.

Someone got this before?

Thanks!

Fernando Aureliano
  • 894
  • 12
  • 35
  • Possible duplicate of [Cannot define multiple 'included' blocks for a Concern (ActiveSupport::Concern::MultipleIncludedBlocks) with cache\_classes = true](https://stackoverflow.com/questions/24244519/cannot-define-multiple-included-blocks-for-a-concern-activesupportconcern) – Tom Lord May 08 '19 at 15:37
  • I tried that but did not solve my problem. – Fernando Aureliano May 08 '19 at 19:42

0 Answers0