대 이전 데이터 내가 필요로하는 어떤 단계에서 이제레일 단일 테이블 상속 내가 레일에 STI 설정이
class Mercedes < Car
class BMW < Car
을 (이름은 무죄를 보호하기 위해 변경되었습니다) 코드에서 Mercedes
에 대한 참조를 제거하지만 이전의 이유로 데이터를 그대로두기를 원합니다.
나는 cars
테이블에서 모든 레코드를로드하려고
ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed
to locate the subclass: 'Mercedes'. This error is raised because the column 'type'
is reserved for storing the class in case of inheritance. Please rename this
column if you didn't intend it to be used for storing the inheritance class
or overwrite Car.inheritance_column to use another column for that information.
type
Mercedes
을 인 cars
테이블의 레코드를 무시하는 방법이 있나요?
실행하려고했던 쿼리는 무엇입니까? – Bijendra
@GhostRider 폭발했을 때 BMW.all을 실행하려고했습니다. 따라서 남은 데이터는 전체 테이블을 쓸모 없게 만듭니다. –