Model methods

Hello, I'm pretty new to ruby and rails.

This is part of my code:

class Command < ActiveRecord::Base
  has_many :executions

  def with_extension(ext)
    Extension.all(:include => :command,
                        :conditions => { :suffix => ext})

And later in my controller I try to do this:
@commands = Command.with_extension('all')

But I gt an error:
undefined method `with_extension' for #<Class:0xb6eaecbc>

That was the first problem, the second is that I'm nut sure how
the with_extension function should look like.

Here's my extension schema:
create_table "extensions", :id => false do |t|
  t.string "suffix"
  t.integer "command_id"

I want to get a list of commands which have a suffix:command mapping.

Niklas Ulvinge
thanks for your time
and wishes everyone
Happy Programming!

with_extension must be defined as class method

def self.with_extension