Я получаю приведенную ниже ошибку со следующими моделями. Я в недоумении, почему. Любая помощь с благодарностью.
Cannot find the child_model Document for Event in documents
/usr/local/rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.1.0/lib/dm-core/associations/relationship.rb:173:in 'rescue in child_model'
Модель документа:
# encoding: utf-8
class Document
include DataMapper::Resource
include Paperclip::Resource
timestamps :at
property :id, Serial
property :name, String, :required => true
property :doc_file_name, String, :length => 255
property :doc_content_type, String, :length => 255
property :doc_file_size, Integer
property :doc_updated_at, DateTime
has_attached_file :doc, :url => "/doc/:attachment/:id/:basename.:extension", :path => "#{settings.root}/public/doc/:attachment/:id/:basename.:extension"
belongs_to :event
validates_attachment_presence :doc
end
Модель события:
# encoding: utf-8
class Event
include DataMapper::Resource
timestamps :at
property :id, Serial
property :name, String, :required => true
property :occuring, DateTime, :required => true
has n, :documents
has n, :contacts
has n, :users
has n, :agendas
has n, :questionnaires
has n, :entries, :required => false
end