Skip to content

Error for models containing at least one concern with included block #5

@movstox

Description

@movstox

Hi and thanks for this gem

If I have a model

class Account < ActiveRecord::Base
  include Avatarify
end

that includes a concern

module Meritify
  extend ActiveSupport::Concern

  included do
    mount_uploader :avatar, AvatarUploader
  end

  def thumb_avatar_url
    avatar.thumb.url
  end

  def normal_avatar_url
    avatar.normal.url
  end
end

and i run

SchemaBuilder::Writer.new.write

via rails console

I'm getting this

ActiveSupport::Concern::MultipleIncludedBlocks: Cannot define multiple 'included' blocks for a Concern
from /home/oivai/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/concern.rb:126:in `included'

If I exclude concern from model, everything works just fine. Would you point me to the right direction? Is there a solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions