Forum: Ruby on Rails acts_as_list with the scope on boolean field

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.
Emin H. (Guest)
on 2006-04-22 03:11
(Received via mailing list)
I have a boolean field in mysql (tinyint) which I want to use as a
scope restriction for acts_as_list

acts_as_list :scope => 'featured = #{featured}'

however, there is a problem here as when Rails generates SQL query for
this it supplements true/false for #{featured} which raises error in
mysql

As a workaround I created dummy attributes that return 1/0 depending
on featured being true/false.

The question is, whether this is a bug or not? I would assume
ActiveRecord should not use true/false if mysql does not understand
this.
This topic is locked and can not be replied to.