I am using acts_as_taggable and everything seems to be working except that
:condition => "tags_resources.portal_id=#{portal_id}"
is not being applied.
@resource_pages = Paginator.new self, Resource.find_tagged_with(:any
=> tag, :condition =>
"tags_resources.portal_id=#{portal_id}").length, 25,
@params[''page''];
@resources = Resource.find_tagged_with( :any => tag, :condition =>
"tags_resources.portal_id=#{portal_id}", :separator=> ''
'',
:limit => "#{@resource_pages.current.to_sql[1]},
#{@resource_pages.current.to_sql[0]}");
I have two Active Record classes, Resource and Tag.
Can anyone please tell what am I missing here?
Many thanks in advance.
Frank
---------------------------------
What are the most popular cars? Find out at Yahoo! Autos
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060130/057fbcec/attachment.html
I believe it should be :conditions plural, no :condition singular. cheers Gerret On 1/30/06, softwareengineer 99 <softwareengineer99@yahoo.com> wrote:> I am using acts_as_taggable and everything seems to be working except that > > :condition => "tags_resources.portal_id=#{portal_id}" > > is not being applied. > > @resource_pages = Paginator.new self, Resource.find_tagged_with(:any => > tag, :condition => > "tags_resources.portal_id=#{portal_id}").length, 25, > @params[''page'']; > @resources = Resource.find_tagged_with( :any => tag, :condition => > "tags_resources.portal_id=#{portal_id}", :separator=> '' '', > :limit => "#{@resource_pages.current.to_sql[1]}, > #{@resource_pages.current.to_sql[0]}"); > > I have two Active Record classes, Resource and Tag. > > Can anyone please tell what am I missing here? > > Many thanks in advance. > Frank > > > ________________________________ > > What are the most popular cars? Find out at Yahoo! Autos > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
Thanks Gerret, for saving the day. At taggable.rubyforge.org, I was following this example: Person.find_tagged_with(:any => ''wine'', :condition => "tags_people.created_by_id = 1 AND tags_people.position = 1") Cheers Frank Gerret Apelt <gerret.apelt@gmail.com> wrote: I believe it should be :conditions plural, no :condition singular. cheers Gerret On 1/30/06, softwareengineer 99 wrote:> I am using acts_as_taggable and everything seems to be working except that > > :condition => "tags_resources.portal_id=#{portal_id}" > > is not being applied. > > @resource_pages = Paginator.new self, Resource.find_tagged_with(:any => > tag, :condition => > "tags_resources.portal_id=#{portal_id}").length, 25, > @params[''page'']; > @resources = Resource.find_tagged_with( :any => tag, :condition => > "tags_resources.portal_id=#{portal_id}", :separator=> '' '', > :limit => "#{@resource_pages.current.to_sql[1]}, > #{@resource_pages.current.to_sql[0]}"); > > I have two Active Record classes, Resource and Tag. > > Can anyone please tell what am I missing here? > > Many thanks in advance. > Frank > > > ________________________________ > > What are the most popular cars? Find out at Yahoo! Autos > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >_______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060130/5ba335e6/attachment.html