MotionModel icon indicating copy to clipboard operation
MotionModel copied to clipboard

Undefined method 'push_relation'

Open tacticiankerala opened this issue 11 years ago • 5 comments

The method push_has_many inside model.rb is calling a method called 'push_relation' but which is not defined at all.

def push_has_many_attr(col, *instances)
    ...
      push_relation(_col, *_collection)
    ...
end

I faced this issue while trying to populate a restaurant model which has many food items. I will try to create a failing spec for the same.

tacticiankerala avatar Jun 26 '13 17:06 tacticiankerala

Can you include your Gemfile as a comment?

sxross avatar Jun 26 '13 18:06 sxross

My Gemfile,

gem "ProMotion", "~> 0.5.0"
gem "bubble-wrap", "~> 1.3.0"
gem "cocoapods"
gem "motion-cocoapods"
gem "motion-testflight"
gem 'motion-dryclean'
gem 'teacup'
gem 'sugarcube'
gem 'sweettea'
gem "motion_model", :git => "https://github.com/tacticiankerala/MotionModel.git"
group :spec do
 gem "motion-facon"
 gem "webstub", "~> 0.3.0" 
end

PS: I forked motion_model yesterday to my git repository and used it because of the issue( https://github.com/sxross/MotionModel/pull/60 )

tacticiankerala avatar Jun 26 '13 18:06 tacticiankerala

@aceofspades -- this changed in commit ffe43c2602fd3b8b7d2cf2fb0a792c3c92d82ec8. Look at model.rb:709. Can you remember what the logic was behind this? Thanks!

sxross avatar Jun 27 '13 00:06 sxross

Unfortunately looks like there were several stacked changes in there so it might be challenging to work backward. Maybe it's best to fix this one the spec is in place.

On Jun 26, 2013, at 5:15 PM, "s.ross" [email protected] wrote:

@aceofspades -- this changed in commit ffe43c2. Can you remember what the logic was behind this? Thanks!

— Reply to this email directly or view it on GitHub.

DougPuchalski avatar Jun 27 '13 00:06 DougPuchalski

@tacticiankerala Let us know when you're able to spec this up, thanks for the help.

DougPuchalski avatar Jun 27 '13 21:06 DougPuchalski