Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

included do ..... end (wrong no of arguments) error

I am implementing a module and including that in a my class by using the RoR ActiveSupport::Concern feature. I am using included do .... end block in that module but facing an error "wrong number of arguments(0 for 1)" for "included do" line.

module Icecream
  extend ActiveSupport::Concerns

  included do  #throws error wrong no of arguments(0 for 1))
    has_many :flavours
    scope :icecreams, ->{where("has_icecreams = ?", true)}
  end
.
.
.
.
.
end

Does included do block even needs arguments?

like image 289
Bloomberg Avatar asked Oct 14 '13 10:10

Bloomberg


1 Answers

oh.... got it fixed...

Stupid typo mistake

extend ActiveSupport::Concerns should be Concern

like image 162
Bloomberg Avatar answered Sep 22 '22 22:09

Bloomberg