여기서 이름 오류가 발생하는 이유를 확인할 수 없습니다. DataMapper를 처음 사용했지만 연관성을 보완하려고 노력했습니다. 어떤 도움을 주셔서 감사합니다.child_model (NameError)을 찾을 수 없습니다.
사용자 :
class User
include DataMapper::Resource
property :id, Serial, :key => true
property :first_name, String
property :last_name, String
property :company, String
property :city, String
property :country, String
property :mobile_number, Integer
property :email_address, String
property :shahash, String
property :isRegistered, Boolean
belongs_to :event, :required => true
end
DataMapper.auto_upgrade!
이벤트 :
class Event
include DataMapper::Resource
property :id, Serial, :key => true
property :name, String
property :occuring, DateTime
has n, :user
end
DataMapper.auto_upgrade!
'has n, : users', 복수형을 사용해야합니다. – ujifgc
'has n, : users '및'belongs_to : event'를 사용할 때 여전히 문제가 있습니다 다른 뭔가가 있습니까? – al3xnull