존재하지 않으며 내 모델관계는 내가 간단한 모듈이 ActiveSupport :: 우려
module Inputable
extend ActiveSupport::Concern
included do
has_many :inputs, as: :inputable, dependent: :destroy
end
end
class Product < ActiveRecord::Base
include Inputable
end
에 포함하지만 Product.first.inputs
를 호출 할 때 내가
PG::UndefinedTable: ERROR: relation "inputs" does not exist
LINE 5: WHERE a.attrelid = '"inputs"'::regclass
: SELECT a.attname, format_type(a.atttypid, a.atttypmod)
Product.reflect_on_all_associations.map { |assoc| assoc.name}
=>[:inputs]
무엇이 잘못 오류를 가지고있다 내 암호로?
입력 모델을 생성하고'rake db : migrate'를 실행 했습니까? 어리석은 질문이지만, 내가 물어볼 줄 알았다. – jvillian
너희 맞아, 내가하지 않았다. – user
입력 이주 코드와 입력 모델을 보여줄 수 있습니까? –