Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 20 lines (17 sloc) 0.658 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
module Timtab
  class Post < ActiveRecord::Base
    set_table_name 'tt_news'
    set_primary_key 'uid'

    establish_connection configurations['timtab']

    has_many :comments, :class_name => 'Timtab::Comment', :finder_sql => Proc.new {
      %Q{
SELECT *
FROM #{Timtab::Comment.table_name} c
WHERE c.external_prefix = "tx_ttnews"
AND c.external_ref = CONCAT("tt_news_", #{id})
}
    }
    has_and_belongs_to_many :categories, :association_foreign_key => 'uid_foreign', :foreign_key => 'uid_local', :class_name => 'Timtab::Category', :join_table => 'tt_news_cat_mm'

    def self.inheritance_column; nil; end
  end
end
Something went wrong with that request. Please try again.