Rails console trick

A Rails console trick I use all the time is:

spinal(prod):012> Channel.find 8
=>
#<Channel:0x0000710e18333fc8
 id: 42,
 workspace_id: 42,
 integration_id: 42,
 slug: "ab12cd34",
 delegate_type: "Channel::Bluesky",
 delegate_id: 42,
 created_at: "2026-10-19 09:12:36.929964000 +0000",
 updated_at: "2026-10-19 09:12:36.929964000 +0000",
 body_template: nil>
spinal(prod):013> channel = _

Now I can use channel. Nice if you forgot to set the variable.


Written on 20 October 2026. Notes written are not publicly listed, but only accessible through the feed. Read previous note. Leave a comment below or send me an email.

What do you think?