Class: PublicContent

Inherits:
ApplicationRecord show all
Includes:
Housekeeping
Defined in:
app/models/public_content.rb

Overview

A snapshot of the working content that is OK for public consumption.

  • This needs work to resolve b/w OTU and other content.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Housekeeping

#has_polymorphic_relationship?

Methods inherited from ApplicationRecord

transaction_with_retry

Instance Attribute Details

#content_idInteger

Returns pointer to the working version.

Returns:

  • (Integer)

    pointer to the working version


25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/models/public_content.rb', line 25

class PublicContent < ApplicationRecord
  include Housekeeping

  belongs_to :otu
  belongs_to :topic
  belongs_to :content

  validates_presence_of :text, :topic_id

  def version
    self.content.version
  end

end

#otu_idInteger

Returns they Otu.

Returns:

  • (Integer)

    they Otu


25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/models/public_content.rb', line 25

class PublicContent < ApplicationRecord
  include Housekeeping

  belongs_to :otu
  belongs_to :topic
  belongs_to :content

  validates_presence_of :text, :topic_id

  def version
    self.content.version
  end

end

#project_idInteger

the project ID

Returns:

  • (Integer)

25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/models/public_content.rb', line 25

class PublicContent < ApplicationRecord
  include Housekeeping

  belongs_to :otu
  belongs_to :topic
  belongs_to :content

  validates_presence_of :text, :topic_id

  def version
    self.content.version
  end

end

#textString

Returns the meat.

Returns:

  • (String)

    the meat


25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/models/public_content.rb', line 25

class PublicContent < ApplicationRecord
  include Housekeeping

  belongs_to :otu
  belongs_to :topic
  belongs_to :content

  validates_presence_of :text, :topic_id

  def version
    self.content.version
  end

end

#topic_idInteger

Returns the topic.

Returns:

  • (Integer)

    the topic


25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/models/public_content.rb', line 25

class PublicContent < ApplicationRecord
  include Housekeeping

  belongs_to :otu
  belongs_to :topic
  belongs_to :content

  validates_presence_of :text, :topic_id

  def version
    self.content.version
  end

end

Instance Method Details

#versionObject


34
35
36
# File 'app/models/public_content.rb', line 34

def version
  self.content.version
end