Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## document.rb
- class Document
- include DataMapper::Resource
- property :id, Integer, :serial => true
- property :name, String, :nullable => false, :lazy => false
- property :body, Text
- property :created_at, DateTime
- property :updated_at, DateTime
- belongs_to :group
- has n, :attachments, :through => Resource
- is_versioned :on => :updated_at
- end
- ## attachment.rb
- class Attachment
- include DataMapper::Resource
- include Paperclip::Resource
- property :id, Integer, :serial => true
- property :comments, String, :length => 255
- has_attached_file :attachment
- has n, :documents, :through => Resource
- end
Add Comment
Please, Sign In to add comment