has-many-polymorphs Questions

0

My product model like this : <?php ... class Product extends Model { ... protected $fillable = ['name','photo','description',...]; public function favorites(){ return $this->morphMany(F...

1

I have the following models. Users have UserActions, and one possible UserAction can be a ContactAction (UserAction is a polymorphism). There are other actions like LoginAction etc. So class Use...
Enthronement asked 3/11, 2010 at 10:16

2

Solved

I'm pretty new to Rails, and i'm trying to do a polymorphic HABTM relationship. The problem is that I have three models that I want to relate. The first one is the Event model and then are two kin...

1

Solved

I got some Manager and SoccerTeam model. A manager "owns" many soccer teams; also a manager can comment on soccer teams and can comment on other managers too: manager.rb # Soccer teams the manage...
1

© 2022 - 2024 — McMap. All rights reserved.