Buck and Koz show put on a sesssion of do’s and don’t s at railsconf – an expression of their fab rails way vision – Helping us to clean up our code with smart coding practices. (Buck and Koz show)

During one session they reinforced we should associations instead of finders to clean up our code.

..and while demonstrating the finders, they left us with a line that read something like “Blog.find_all_by_author_id” – and I thought to myself. No, they must be wrong. Don’t associations have the same sugar? I can’t remember the exact code, but a few of us thought the use of the syntax wasn’t quite free…

Can’t I do Blog.find_all_by_author(@author). Isn’t that clearer?

Banging on our laptops in the lunch space, it seems they don’t exist.

Not for long. This is railsconf.

And so is the intro, that started with chatting with Chris O’Meara @ Code Rhythm(and Chris’ bud) and ended with me pounding keys at PDX and JFK while Tibet Sprague of Public Display was knocking off the code for a new startup.

and along the way if find myself wondering around rails internal into method_missing and extending AR find methods.

I hope you enjoy find_by_association and the joys of syntactic sugar.

Read the rest of this entry

savage beast

May 18th, 2007

Extracted from The Soup (the-soup.net) is the Savage Beast plugin - a rails engine of the popular Beast forum. Savage Beast simplifies the addition of multiple forums to your rails app, associating 1 or more forum to a AR Model instance. For instance adding a forum to a project model,
1
2
3
4

class Project < ActiveRecord::Base
  has_one :forum, :as => :owner, :dependent => :destroy
end
as you can note above, SB adds a model attribute to polymorphically relate to the forum owner. If you are doing nested routes to forums, topics and posts, overload the appropriate controller and before filter. For instance, if you route /project/1/forum, the forums_controller may look like:
1
2
3
4
5
6
7
8
9
10
11
12
13
14

class ForumsController < ApplicationController

  #this is the standard before filter called by SB
  def find_or_initialize_forum
    if params[:id] && params[:project_id]
      @project = Project.find(params[:project_id])
      @forum = @project.forum.find(params[:id])
    elsif params[:id]
      @forum = Forum.find(params[:id])
    end
  end

end
As this is a engine, overloading is pretty simple - but I must say that the great encapsulation of behaviour in the Beast, makes for an easy isolation of functional concerns, and the above use of before filters was almost all the customization that The Soup needed to integrate multiple forums. You can get Savage Beast here: Enjoy. If you have question please fwd by email. requires rails 1.2 and the latest engines plugin. http://svn.nnovation.ca/svn/savage_beast/trunk ------------------------------------------------------------------------ With help from Nick Coyne, we've nailed down a number of gotcha's when integrating Savage Beast, and even come up with a demo application you can use to learn the rules for integrating. The demo app is at: http://svn.nnovation.ca/svn/savage_beast_demo/ (it svn externals savage_beast) Below are more notes that will aid in integration: The demo app uses acts as authenticated (see the routes file for signup/login/logout urls - not included in the user interface) In the demo app, you'll want to grab the migration "003_add_post_count_to_user.rb" - this migration adds 2 columns to your user table that beast wants - I'll eventually include them into the savage_beast plugin. In the demo routes file, you'll also notice:
1
2
3

  #get routes for beast
  map.from_plugin :savage_beast
which gets all routes that beast depends on. The remaining routes in the demo are only there for the app (not the forum). You'll also want to add include SavageBeast::UserInit to your user model - gets a bunch of dependent methods for beast - take a look at the lib, and over-ride what's important to you (like user.display_name, admin? and logged_in?) As a final note, there are three controller before_filters that you'll want to over-ride if you have custom routes/params. Take a look at:
1
2
3
4
5
6
7
8
9

ForumsController
 before_filter :find_or_initialize_forum

PostsController
before_filter :find_post

TopicsController
 before_filter :find_forum_and_topic
Overiding the above filters in your own TopicsController (etc) is a great way to embed the forum within custom urls. One final note - Beast depends on a few plugins: white_list, white_list_formatted_content, browser_filter - oh and SB requires engines. If you run into integration issues, or suggestions please let me know. thanx for your help Nick. These notes will eventually turn into real docs - for now, that's all I can provide. enjoy

It’s taken months to assemble a v1 release of The Soup. I’ve been stealing away every free minute to pour into this baby, and now I feel a great sense of release. I think my wife and 2 year old remember me - hopefully they let me back in.

Finished not a moment too late - knackered as our UK cousins say - and just in time to take a break. Next week I’m off to Rails Conf to learn, hookup with all the cool kids,learn, relax..

I really intended to make a nice series of blog entries to track the thought progression for The Soup, but alas, who’s got time to do and write?! Better folks than me I guess.

Well onto the next stage. Bug fixes and planning for v2. Oh, all that client stuff that’s backed up!


This article explores both the business and technology progress of a new startup - code named “Stonezoup”. Wearing both technology and business hats, I will shift back and forth - compromising, grumbling, lying awake at night, excited to take the next step.

Being a technologist who was ran software companies, I hope this series will help my fellow technologists chart the journey from a good idea along the path towards a substainable venture. The mixture of skills required can be daunting, and usually the science of “what step comes next” can be as much about the art of asking the right questions.

Read the rest of this entry

The following discussion studies the value proposition of the Software as a Service (SaaS) business and licensing model. Additionally we’ll look at the sales, marketing and cultural and operational challenges it presents for corporations looking to deploy such a model.

Part I in this series evaluated the Value Proposition, or “what makes this business model interesting to the customer”. You may find that introduction will help as an introduction to this one. Additionally in Part II we examined the specific SaaS Revenue Model and Operating Expenses.

This section, considers the cultural, Technical, Sales and Customer Facing challenges identified to successfully execute an SaaS business Model. As before, the ISV model is contrasted to highlight these challenges.

Read the rest of this entry

I’ve just started a new project so I’m starting with 1.2RC and the experimenting with BDD with rspec.

I won’t delve into either as folks with more FU than myself have explored both topics.

Specifically though I have run into problems with rspec and the new simply_helpful - thankfully Lourens of methodmissing has nailed down a monkey patch.

Laurens also supplies a monkey patch to permit testing of various return types - but, alas, since rspec is maturing at the speed of light it doesn’t work with rspec 0.7.4.

Read the rest of this entry

The following discussion studies the value proposition of the Software as a Service (SaaS) business and licensing model. Additionally we’ll look at the sales, marketing and cultural and operational challenges it presents for corporations looking to deploy such a model.

Part I in this series evaluated the Value Proposition, or “what makes this business model interesting to the customer”. You may find that introduction will help as an introduction to this one.

This section, considers the Revenue Model and Operating Expenses. We’ll look at the inherent implications of this model and it’s specific financials as contrasted with the ISV licensing model.

Read the rest of this entry

innovation is not enough

December 3rd, 2006

As with porn, it seems that spamming (marketers) are on the cutting edge of technology and uses thereof. Just as the pr0n industry were early adopters of Beta video and at one time were one of the only industries making money on the back of our beloved infrastructure, today we find innovative spammers pushing the envelope (and our patience!).

PayPerPost comes to mind. (from the web site) “Get paid for blogging. Write about websites, products, services”. I wonder if bloggers get paid for bad reviews? Talk about conflict of interest.

Coincident with the above PPP discovery, my wife and I were researching elliptical cross-trainer. In particular we were interested in reviews of the Iron*Man ET30. A google search revealed a number of the usual suspects (fake review sites, without any reviews but aggregated prices - can you read affiliate?).

And this one….

Read the rest of this entry

The following discussion studies the value proposition of the Software as a Service (SaaS) business and licensing model. Additionally we’ll look at the sales, marketing and cultural and operational challenges it presents for corporations looking to deploy such a model.

Part I in this series evaluates the Value Proposition, or “what makes this business model interesting to the customer”. Part II considers the Revenue Model and Operating Expenses and III concludes with the Challenges faced.

For ease of consideration, many of the arguments are contrasted against the traditional ISV licensing and business model.

Read the rest of this entry

This first post is firstly a test of Mephisto, the CMS that I've built this site with - less than 8 hard hours (mostly CSS) and TNG is done! (as my 2 year old says "I Did It! TaDa!!")

Mephisto is a Rails based blogging/cms system. I've been intending to use CMS for the corporate website plus a site for my wife's naturapathic clinic (long past due, I may say). With the ease of this implementation, I'll have little reason for not getting her up asap.
Read the rest of this entry