Forum: Rails-ES Populator con relación has_and_belongs_to_many

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B7de309e2f3436b5b1c0b5c18dad089d?d=identicon&s=25 Carlos Belizón Ibañez (paliyoes)
on 2009-05-20 19:47
Y dado que tengo definido el modelo de esta forma:

class Season < ActiveRecord::Base
  has_and_belongs_to_many :clubs
end

class Clubs < ActiveRecord::Base
  has_and_belongs_to_many :seasons
end

Y tengo hecha la siguiente migración para la tabla de unión:

class CreateTableClubsSeasons < ActiveRecord::Migration
  def self.up
    create_table :clubs_seasons, :id => false do |t|
      t.integer :club_id
      t.integer :season_id
    end
  end

  def self.down
    drop_table :clubs_seasons
  end
end

¿Cómo puedo usar populator para crear los datos aleatorios de prueba en
mi aplicación?
This topic is locked and can not be replied to.