Skip to content

Instantly share code, notes, and snippets.

@wmoxam
Created October 15, 2010 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wmoxam/628440 to your computer and use it in GitHub Desktop.
Save wmoxam/628440 to your computer and use it in GitHub Desktop.
## app/models/legacy/article.rb [ruby_on_rails]
class Legacy::Node < Legacy::Base
set_table_name 'node'
set_inheritance_column :node_type
set_primary_key :nid
default_scope select("*, concat('Legacy::', IF(type = 'ic_article', 'Article', IF(type = 'ic_video', 'Video', concat(UPPER(SUBSTRING(type, 1, 1)), LOWER(SUBSTRING(type, 2)))))) as node_type")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment