Vita Rara: A Life Uncommon

Ruby

Mark's [J]Ruby on Rails Notes


Categories: | |

Using GoldSpike to run Ruby on Rails in Standalone Mode

When running Ruby on Rails in a war using the GoldSpike servlets and context-param jruby.standalone is set to true you will need to use the jruby-complete jar file. Rails requires Gems in order to boot strap. I found that using the jruby jar file caused Rails to fail in initializer.rb when it tried to require 'logger' which is included in the ActiveSupport gem.

Also be sure to copy your required gems into WEB-INF/gems.

[EDIT: Better yet use ruby gem install --install-dir WEB-INF/gems. ]

Model Auto Completer

Ruby Metaprogramming: Declaratively Adding Methods to a Class


Categories: |

In this brief piece I will examine Ruby's support for metaprogramming and how to define class level methods that add instance methods to our class implementations at run time.

Over the past few months I've been learning Ruby on Rails. One of the most attractive features of Rails its declarative style of defining relationships and validations on models; and filters on actions.

A simple example of this declarative style:

class Party < ActiveRecord::Base
  has_many :addresses
end

This class defines a Party model that can have many addresses. The simple "has_many :addresses" declaration is a great example of the power of Ruby. This simple statement adds a number of methods to our Party class, and allows us to easily manage relationships between our parties and their addresses.

Setup (RESTful) Authentication First


Categories:

Well, I've learned a lesson, so learn from me, and don't repeat it. If you're going to use either of the Rails authentication plugins (restful_authentication or acts_as_authenticated), just set them up first, before you start into your own user models, etc. It's much easier that way.

Thank You Zed


Categories:

Dear Zed,

About that long Ruby on Rails rant against its core developers, the Rails community, those of us coming late to the party from other languages and platforms, and just about everyone else in sight... ok, credit where credit is due, Obie Fernandez and Mingle came in for some praise. Anyway, I won't hash it all out again. I really don't care. I will say though I strongly disagree with how you went about it. Bile is bile, and what you wrote is bile. I'm reasonably qualified in the taxonomy of Internet writing to make the identification. (Yes, I've written my share of flames, but none quite so base as yours.)

How I Use Rails Migrations for a New Project


Categories:

Yesterday I started a new Rails project and it got me thinking about how I use migrations at the start of a project. I generally start with models and migrations when I begin a new project.

My usage of migrations tends to differ in the first day(s) of a Rails project. I will frequently roll the version of the data schema between 0 and the current version. I do this because if I forget a field/property on a model I don't define a new migration to add it, I just roll the schema back to 0 (rake db:migrate VERSION=0), change the create table migration, and then do a rake db:migrate to bring the schema right up to date. I find this the most pragmatic method early on and I continue to use it until I can't.

The Future That Has Already Happened


Categories: | | | | | |

January second's Daily Drucker dealt with the future, but not as most business prognosticators or futurists might. As Drucker states it, "The important thing is to identify the 'future that has already happened...'"

The action point for the day is to identifying those trends in our market that have already happened, write about their longevity and their effect on our life and organization.

Software as a Service For the Rest of Us

Over the past few years, and particularly in 2007 Software as a Service (Saas) has really broken out and has become a force in the software industry. The first large scale SaaS offering that really broke through to my consciousness was Salesforce.com, then for me came Basecamp from 37signals.com. Salesforce.com represented a high level enterprise offering, with a high level of complexity and expense. Basecamp brought software as a service home to us all.

2007: A Retrospective


Categories: | | | | |

Personal Life

Sylva and I got married on April 28. It's been a real whirl wind since then. We are expecting our first child on April 1, 2008. My time with Sylva is special and precious. I have a great partner, and look forward to raising a family together.

Overall business issues have dominated this year. I doubt that will be that case next year.

Business

It was a hard business year, but prospects for the future look good.

Quadran

Quadran has arrived. About 63,000 lines of Groovy, Java and JSP, with some XML files to wire it all together, and it's up and running. We turned on our first Quadran installation on December 5, 2007. This was the culmination of a process that began with an initial meeting in September of 2004, and the consummation of the development agreement in July of 2006.

Multi-Model Forms in Ruby on Rails


Categories: |

This isn't going to be an exhaustive tutorial on multi-model forms, but more of some observations from my learning to work with them over the past week. For a great introduction to multi-model forms see Railscasts. The major issue I've found if that the error messages when things go wrong, particularly at the view layer are almost meaningless or at worse utterly and totally misleading.

Walking into the Light: A Week With Ruby on Rails


Categories: |

This past week or so two developers whom I greatly respect and admire really opened my eyes. It's been an interesting time since then. On October 23 on the Struts Developer list Craig McClanahan wrote:

Why the long winded diatribe? Because while I'd *love* to see life made simpler for Java web developers, and a lot of the things happening in Struts2 are going that way -- it won't be me doing it. I've gone over to the dark side :-) and much prefer to develop in Rails -- for the conciseness mentioned above, but also because I don't ever have to do a "build" or "deploy" step during my development cycle any more. But you guys and gals need to be reminded that *this* is the kind of thing you are competing against if you expect to attract Rails developers ... or to avoid even more "previously Java web developer" defectors like me :-).

To which Ted Husted followed up:

Personally, I'd characterize going over to Rails as walking into the light :)

Using Globally Unique Id's in Ruby on Rails


Categories:

I'm starting to play with Ruby on Rails a bit, and liking it so far. Over the past year I have been so preoccupied with work on ongoing projects that I really haven't had the time to experiment with RoR. I'll write more about why I finally got off the mark and tried it out later. Short story is I like to so far.

For years now I have moved away from using incrementing integers as id's in my database designs. I have been using string based globally unique id's. I really don't want to leave these behind, plus I'm looking at interoperating with some databases that use them already. So, I had to find a solution. It took a bit of Google'ing, but I think I've found a solution.

Syndicate content