Ruby on Rails Wednesday, November 26, 2014


On Wed, Nov 26, 2014 at 6:49 PM, Colin Law <clanlaw@gmail.com> wrote:
You are right of course.

​I got the answer from another mailing list. Created a static method on the Tag model

def self.for_groupmessages_created_on(group_id,fromdate,todate)                      Tag.joins(:messages, :groups).where(                          messages: {                                                       created: fromdate..todate                                 },                               groups: {                                                         id: group_id                                              }       
)  

Thanks,
Ganesh​

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CALFmRoEbkkco688%2BWzPdw3U%3DmqfAtusPLH71gRK9t0FBGG0Mtw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment