On 30 August 2015 at 23:27, venu madhav chitta
<
venu.ch...@gmail.com> wrote:
> No they just use existing tables, do some joins and generate the item
> recommendations. Their interface looks like: recommendations(user_id) and
> returns [item_id]
First if you are using joins manually then it may be that you have
specified the associations incorrectly as it should only rarely be
necessary to specify the joins. In addition you said in the original
post that you were using sql to query, this is almost certainly not
right unless you are doing something rather complex that the rails
activerecord interface will not handle. If you want advice on that
then ask a separate question showing the query you are performing.
So if I understand correctly you have some code that references
several tables but it does not seem appropriate to just put the code
inside one of the models. In such situations I would either make it a
model which is not derived from ActiveRecord or put it in a module in
lib. Whichever seems most appropriate. Probable a model in your
case. Don't get stressed over exactly where you put things however,
there are no hard rules, just do whatever seems most appropriate for
your case.
Colin
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to
rubyonra...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/rubyonrails-talk/c9c746c9-2957-49a3-a9ba-f52aa7ae61ec%40googlegroups.com.
>
> For more options, visit
https://groups.google.com/d/optout.