Forum: Ruby on Rails ActiveRecord and BOOL columns

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.
rails_lists (Guest)
on 2005-11-12 13:50
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm aware that AR automatically turn TINYINT(1) into a true or false
object, but does it create an attribute accessor that uses Ruby
naming conventions?
Example: User.logged_in is either true or false, but can I call
User.logged_in?

If not, is there anyone working on this, or any reason why it would
or would not be a good idea?

Thanks,
- --Jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFDdTZYG9xIoXK+giARAlZEAKDgAXOvFIb8HiT9Ex7G3HiPEOHcDACeI2UQ
kk4KvM4LP2Z/Q51/K9Dlw5k=
=myLt
-----END PGP SIGNATURE-----
jeremy (Guest)
on 2005-11-12 13:50
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Nov 11, 2005, at 4:24 PM, Jeff S. wrote:
> I'm aware that AR automatically turn TINYINT(1) into a true or
> false object, but does it create an attribute accessor that uses
> Ruby naming conventions?
> Example: User.logged_in is either true or false, but can I call
> User.logged_in?
>
> If not, is there anyone working on this, or any reason why it would
> or would not be a good idea?

It does.

./script/console is crying your name :-)

jeremy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDdTlOAQHALep9HFYRAupyAJsEGUBw5CFI7kUV05rxBqs2NwseAACeL8Qk
2mosOn2+zJzipIBusfVy4F0=
=VF+p
-----END PGP SIGNATURE-----
This topic is locked and can not be replied to.