Forum: Ruby on Rails :condition not being applied

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
softwareengineer 99 (Guest)
on 2006-01-30 19:44
(Received via mailing list)
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
Gerret A. (Guest)
on 2006-01-30 19:53
(Received via mailing list)
I believe it should be :conditions plural, no :condition singular.

cheers
Gerret
softwareengineer 99 (Guest)
on 2006-01-30 20:05
(Received via mailing list)
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 A. <removed_email_address@domain.invalid> wrote:  I believe it should be
:conditions plural, no :condition singular.

cheers
Gerret
This topic is locked and can not be replied to.