Welcome Guest, Not a member yet? Register   Sign In
ActiveRecord using model in another model
#2

[eluser]xwero[/eluser]
Why do you put the getCategoryName in the Newscontent model? It should be in the Newscategory model where it belongs.

If you want your Newscontent model to output the category name or another category value you are better of creating a two table query. It's not forbidden to use joins in models Smile


Messages In This Thread
ActiveRecord using model in another model - by El Forum - 03-26-2008, 04:49 AM
ActiveRecord using model in another model - by El Forum - 03-26-2008, 05:13 AM
ActiveRecord using model in another model - by El Forum - 03-26-2008, 05:32 AM
ActiveRecord using model in another model - by El Forum - 03-26-2008, 05:52 AM
ActiveRecord using model in another model - by El Forum - 03-26-2008, 05:57 AM
ActiveRecord using model in another model - by El Forum - 03-27-2008, 04:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB