You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.
When I reap simple tables with no associations it seems to work fine, for example if I reap ONLY User and Community, individually, or together.
However, when I try to reap User, Community, AND UserProfile I consistently get one of the following two errors (depending upon what subset of the data I try to reap):
no implicit conversion of nil into Stringr UserProfile:
(possible clue: that extra 'r' after the word String?)
or undefined methodfetch' for false:FalseClasserProfile:`
the UserProfile table has 2 'parent' tables:
belongs_to :user
accepts_nested_attributes_for :user
belongs_to :community
accepts_nested_attributes_for :community
(User has_one :user_profile, and COmmunity has_many :user_profiles)
Even when I define a method self.for_seed_db which is so specific it selects a single User and UserProfile, and run
I dug around and couldn't figure out any points of failure in Sprig-Reap that would throw those errors. Are the classes referenced in those errors, Stringr and FalseClasserProfile, defined in your application?
Sprig-Reap appears to be calling methods from your application code on things that are nil or false. It's hard for me to tell what exactly those method calls are without more context or a bigger stack trace.
Could you either show me the User & UserProfile models or a bigger stack trace to see if it sheds any light on where the error is originating from?
Hi neither Stringr nor FalseClasserProfile occur in our source code anywhere. I'll work on getting a detailed stack trace, thanks. The stringr thing made me wonder if it's possible there's a typo in your code that under certain conditions a nil object is being converted to class called stringr instead of string.
When I reap simple tables with no associations it seems to work fine, for example if I reap ONLY User and Community, individually, or together.
However, when I try to reap User, Community, AND UserProfile I consistently get one of the following two errors (depending upon what subset of the data I try to reap):
no implicit conversion of nil into Stringr UserProfile:
(possible clue: that extra 'r' after the word String?)
or
undefined method
fetch' for false:FalseClasserProfile:`the UserProfile table has 2 'parent' tables:
belongs_to :user
accepts_nested_attributes_for :user
belongs_to :community
accepts_nested_attributes_for :community
(User has_one :user_profile, and COmmunity has_many :user_profiles)
Even when I define a method self.for_seed_db which is so specific it selects a single User and UserProfile, and run
rake db:seed:reap TARGET_ENV=development MODELS=UserProfile.for_seed_db,User.for_seed_db,Community
I get the error
no implicit conversion of nil into Stringr UserProfile:
but it correctly reaps the single User and the set of Communities.
Adding OMIT_EMPTY_ATTRS=true doesn't help.
Any thoughts what could prevent a specific table from being reaped and giving either of those two errors?
Rails 3.2.21, ruby 2.1.5, running on a Mac.
The text was updated successfully, but these errors were encountered: