Which associations should I use? to extend ad model.

I would like to use only one table ads on database.

regular AD:

trip AD:

Which associations should I use?
Polymorphic Associations
The has_and_belongs_to_many

I create a Gist with my recent ideas: https://gist.github.com/1770515

what are the other objects? What is it that has_and_belongs_to_many?
for polymorphic relationships you want to ask if more than one
class Ad
   belongs_to :adable, :polymorphic => true

class Customer
   has_many :ads, :as => :adable

class NewsPaper
has_many :ads, :as=>:adable

At least I think this is what you are looking for. Maybe some others
will give advice.

STI , Single Table Inheritance (This structure is best used for
models that have identical, or very similar attributes )

trip AD << regular AD

class RegularAd < ActiveRecord::Base
class TripAd < RegularAd

migration (Rails 3.1)
class CreateAds < ActiveRecord::Migration
  def change
    create_table(:regular_ads) do |t|
      t.string : title
      t.float : price
      t.string : content
      t.string : username
      t.integer : from
      t.integer: to

I think form me i should be something like this below because I need different validations to each type of ads. Or in your example could i set up this kind of different validations?

class Ad < ActiveRecord::Base

validates_presence_of :name, :email, :price(?), :category_id(?)














> class RegularAd < Ad

> validates_presence_of :title, :ad_content


> :title

> :ad_content

> end