With Rails’s ActiveRecord and presumably other object-relational mappers, it is easy to use persistent, database-backed objects as if they were just there. Create new objects, navigate along associations, just like that. This picture breaks down however, when it comes time to ensure those in-memory changes are saved back to the database. In general, in a […]
Archive for the 'Ruby' Category
Over the years, I’ve ripped CDs in various formats. In the beginning, it was MP3, but I soon switched to OGG. A few years ago I, it made the switch to FLAC. Unfortunately, that leaves me with a large “sediment” of files in lossy formats and I’ve started to rip those again — for the […]
What’s new? Rake tasks are cached (thanks to turadb). If there is no Rakefile in the current directory, ancestor directories are searched in the way Rake itself does. Installation Copy the file to /etc/bash_completion.d or possibly /usr/share/bash-completion/completions or to another place where it is loaded when your Bash shell is started.
A presentation I held on May 28 at Düsseldorf on Rails about interesting and useful things you can do with ActiveRecord, SQL, and a smart database. german english .
Didn’t you always want to write your Rails views as plain Ruby objects? — “What?”, I hear you say. No, I haven’t lost my mind and the idea is quite sensible (or so I hope), once you add the restriction that it is JSON-formatted data that you want to return. Say you need to set […]
Victor Serbin sent me a version of the completion updated for Gem 1.0.1. You can get it here. Apparently, Ubuntu and Debian have begun to bundle this file with their rubygems packages. Great!
The gem command is the command line user interface to the RubyGems system for managing Ruby packages. This command has a few sub-commands itself and a long list of options that differ per sub-command. Remembering and typing them can be tedious, but thankfully, if you are using the bash command shell, it can help with […]
It was late last night. And the night before, I admit it. I also admit that I don’t know much about what Web 2.0 is all about, but there are two things that I do know: rounded corners are involved and, of course tags and tag clouds. Tagging is work, therefore ipso facto to be […]
Variations on the Decorator Design Pattern in Ruby have already been discussed in several places. For my special purpose, none of these approaches works. The common problem with a decorator based on delegation is the lost sense of self. Method calls of the decorated object to itself are not routed through the decorator, therefore remain […]
I’m using Eclipse with RadRails to edit my Ruby and Rails code (and, yes, I’ve used it for Java, way back when). Inside Eclipse the various text editors offer so-called templates. These are snippets of common code with placeholders for variable bits. Type in the abbreviation for a template, then type Ctrl-Space and the abbreviation […]