ruby-on-rails factory_bot动态或静态定义属性method_missing

6ljaweal  于 4个月前  发布在  Ruby
关注(0)|答案(1)|浏览(45)

当我使用factory_bot_rails(6.1.0)并且我已经定义了静态属性时,得到了这个错误,

gems/factory_bot-6.1.0/lib/factory_bot/definition_proxy.rb:99:in `method_missing': undefined method 'apply_as' in 'apply_as_agent' factory (NoMethodError) Did you mean? 'apply_as { :agent }''

字符串

sgtfey8w

sgtfey8w1#

我已经在Gemfile中将factory_bot_rails替换为gem 'factory_bot','~> 4.11','>= 4.11.1'。
这对我很有用!Reference Link

相关问题