Welcome Guest, Not a member yet? Register   Sign In
ActiveRecord for CodeIgniter: Rails-style model interactions

[eluser]webthink[/eluser]
I don't think has_many_through is what I wanted but it is very interesting. If I understand what it does correctly I think my modification may actually, unwittingly, help accomplish it.

If in the user model you define has_and_belongs_to_many ('users') relationship (I'm not 100% sure this is possible).

You could then have a users_users table with the fields first_user_id, second_user_id (my mod allows those fk conventions and allows you to join the same table on seperate foreign keys)

The question mark is really the first part. I do know for instance that you can already do a self referential join by doing something like $this->user->join('users')->find_all(); If you've got a field called user_id in your users table.


Messages In This Thread
ActiveRecord for CodeIgniter: Rails-style model interactions - by El Forum - 04-10-2008, 11:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB