0
방금 레일스 마이그레이션에서 두 개의 테이블을 만들었습니다. 하나는 ShippingLabel
이고 다른 하나는 Shippo
이라는 모델입니다. 마이그레이션이 성공적으로 실행되고, Postgres에 테이블이 올바르게 생성되며 Shippo를 상수로 인식하는 것처럼 보입니다. 그러나 ActiveRecord :: Base에서 상속받지 않는 것은 Shippo에 적합합니다.레일 모델이 ActiveRecord :: Base로부터 상속받지 않습니다.
shippo.rb
class Shippo < ActiveRecord::Base
end
및
shipping_label.rb
class ShippingLabel < ActiveRecord::Base
belongs_to :device_purchase
end
내가 ShippingLabel < ActiveRecord::Base
를 실행 나는 true
를 얻을. 콘솔에서 Shippo < ActiveRecord::Base
을 실행하면 nil
이 표시됩니다.
테이블 이름은은'shippos'와 포스트 그레스 –
에서'shipping_labels'은 레일 콘솔을 다시로드하려고합니다. – Ilya
@llya'reload! '를 시도해 보았습니다. 여러 번 빠져 나오면 안됩니다. –