Jay McGavren's Journal

2008-07-29

I didn't know you could combine postfixes...

irb(main):009:0> 1 if true unless false
=> 1
irb(main):010:0> 1 if true unless true
=> nil
irb(main):011:0> 1 if false unless false
=> nil
irb(main):012:0> 1 if false unless true
=> nil

Read more...
2008-07-29

You are logged in as: jay2

Rails 2.0 Forum

Logout | Contact Us Reply was successfully created. Forum: Beginners Subject: Does my username show up? Body:

Nope.

I think I need to add a validates_presence_of :user to the Topic and Reply models.

Read more...
2008-07-25

Yes. Yes! YES!!!!

E3 2008: Geometry Wars: Retro Evolved 2 Hands-On - Xbox 360 News at GameSpot

Including… (drumroll) local 4-player co-op! I was seriously considering writing a clone via Zyps just to get this feature (not to mention hooking a PC up to the TV and acquiring multiple game pads). Now I don’t have to. (Though I still might, since it doesn’t look like they have online play.)

Read more...
2008-07-23

ActiveRecord associations are neat!

class Album < ActiveRecord::Base
	has_many :songs
end
>> album.songs < [#]
>> album
=> #
>> song
=> #

Note that empty album_id…

>> album.save
=> true
>> song
=> #

album_id is populated…

mysql> select * from songs;
+----+----------+-------------+--------------+
| id | album_id | name        | track_number |
+----+----------+-------------+--------------+
|  1 |        8 | First Track |            1 |
+----+----------+-------------+--------------+

And the song is saved as well. Nice to have stuff done for me for once! (Let’s see if my attitude changes when Rails volunteers to do something I didn’t want done.)

Read more...
2008-07-22

Totally Acts Like...

pope benedict xvi, darth sidious
see famous look-a-like faces

Read more...