Skip to content

Instantly share code, notes, and snippets.

@flexd
Created November 27, 2008 18:00
Show Gist options
  • Save flexd/29831 to your computer and use it in GitHub Desktop.
Save flexd/29831 to your computer and use it in GitHub Desktop.
class Group < ActiveRecord::Base
require 'ftools'
cattr_accessor :update_sql
@@update_sql = "
SELECT
groupID as id,
categoryID as category_id,
groupName as name,
description as description,
graphicID as graphic_id,
useBasePrice as use_baseprice,
allowManufacture as allow_manufacture,
allowRecycler as allow_recycler,
anchored as anchored,
anchorable as anchorable
published as published
"
def desc
RedCloth::new(self.description).to_html
end
def to_param
"#{id}-#{name.gsub(/[^a-z0-9]+/i, '-').downcase}"
end
end
~
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment