Sha256: d9a1f78d58355fde04bee54927345fe6b00d27b73d8f7f6290e10d85127c5da7
Contents?: true
Size: 650 Bytes
Versions: 12
Compression:
Stored size: 650 Bytes
Contents
# encoding: utf-8 class Document < ActiveRecord::Base has_one :section has_one :author acts_as_metadata end # Persist ancestor class Section < ActiveRecord::Base belongs_to :document acts_as_metadata :ancestors => [:document], :persists_ancestor => true end # Does not persist ancestor class Author < ActiveRecord::Base belongs_to :document acts_as_metadata :ancestors => [:document] end class Chapter < ActiveRecord::Base acts_as_metadata ancestors: [:sections, :document] has_many :sections end class User < ActiveRecord::Base has_one :inbox @@current_user = User.create! def self.current @@current_user end end
Version data entries
12 entries across 12 versions & 1 rubygems