A Fresh Cup is Mike Gunderloy's software development weblog, covering Ruby on Rails and whatever else I find interesting in the universe of software. I'm a full-time Rails and iOS developer.

Navigation

A Fresh Cup

Notes on Rails and other development

Tuesday
Apr212009

Double Shot #435

Rainy spring weather says "stay in and code." It's a conspiracy!

  • peeping into memcached - How to get internal stats about memcached, and what you can do with them.

  • Installing memcached on OS X 10.5.4 Leopard - Easiest set of instructions I was able to find on short notice.

  • Ruby on Rails GSoC Projects - The winners for this summer.
  • Monday
    Apr202009

    Double Shot #434

    Busy weekend leads to lots of Monday links.
  • This Week in Edge Rails - Even if you don't normally read TWIER, this edition has some info on the state of the Rails 3 codebase.

  • Strongbox - Public key encryption for Active Record attributes. (via Thoughtbot)

  • Firediff - Firebug extension that tracks real-time changes to the DOM and CSS of a page.

  • GitHub Developer Site - The new GitHub API appears to be quite comprehensive. There's a start at a ruby interface for it.

  • backports - Library bringing various bits of Ruby 1.9 to Ruby 1.8.x.

  • YAAC - Another YAML-based configuration class for Rails.

  • An overview of modern SQL-free databases - I'm still not feeling compelled to switch to a nonrelational database myself, but lots of people are playing with these things.

  • Ruby 1.8.7-p160 and 1.8.6-p368 released - Bugfix time. I don't know that anyone has tested Rails with these yet.

  • Why Programmers Suck at CSS Design - Together with some advice for doing it anyhow.
  • Sunday
    Apr192009

    Touch your Active Record Instances

    Now that Rails 2.3 is out and the core team has caught their collective breath, new features are starting to make their way into Rails. The latest: an implementation of touch for Active Record. This is in edge for both 2-3-stable and master (to be 3.0).

    At its simplest, touch is just a bit of syntactic sugar that writes the current time to the updated_at or updated_on attribute of an ActiveRecord instance. This does not short-circuit the validation code, so if there are errors in the instance you'll get ActiveRecord::RecordInvalid raised:

    [sourcecode language='ruby']
    @order.touch
    [/sourcecode]

    But wait, there's more! You can specify a different attribute to touch if you'd like:

    [sourcecode language='ruby']
    @order.touch(:shipped_at)
    [/sourcecode]

    You can also specify touch options when defining a belongs_to relationship:

    [sourcecode language='ruby']
    class Order
    belongs_to :customer, :touch => true
    end
    [/sourcecode]

    In this case, saving or destroying an order instance will touch the corresponding customer instance. This is useful in cases where, for example, you're caching customers but want them invalidated from the cache when a counter cache changes. You can also specify a particular attribute on the parent model to touch:

    [sourcecode language='ruby']
    class Order
    belongs_to :customer, :touch => :orders_updated_at
    end
    [/sourcecode]
    Friday
    Apr172009

    Double Shot #433

    Gonna be an interesting week to write about edge Rails.

  • RubyPAN - New searchable gem indexing site.

  • Phusion Announces Passenger for Nginx - Another interesting twist in the Rails hosting story.

  • GitHub Issue Tracker! - Not full-featured, but nice for random little bits of code you keep on GitHub.
  • Thursday
    Apr162009

    Double Shot #432

    Not having a shortage of things to do is good, right?

  • JRuby Moves to Git - And joins all the other cool kids.

  • Rails 2.3.2 upgrade gotchas - Some notes from Thoughtbot.

  • Mockups 1.6 Release: Linking Mockups, and More! - A nice new feature for the excellent Balsamiq Mockups.