vendredi 27 février 2015

Rails doesn't load fixtures when working with STI

I have these models:



class Company < ActiveRecord::Base
end

class Enterprise < Company
has_many :establishments
end

class Establishment < Company
belongs_to :entreprise
end


and these fixtures:



#enterprises.yml
johns_enterprise:
owner: John
name: John & co..
trade: John s Enterprise
cnpj: 11222333000111

#establishments.yml
josephs_establishment:
owner: Joseph
name: Joseph & co..
trade: Josephsss
cnpj: 99888777000122


When I run



rake db:fixtures:load


just establishments data are loaded. Anybody knows why?


Aucun commentaire:

Enregistrer un commentaire