Class: PublicContent

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

Overview

TODO:

PublicContent definition…

  • 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 included from ActiverecordUtilities

#trim_attributes

Instance Attribute Details

- (Integer) content_id

TODO:

Returns:

  • (Integer)


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

class PublicContent < ApplicationRecord
  include Housekeeping

  belongs_to :otu
  belongs_to :topic
  belongs_to :content

  validates_presence_of :text
  validates :topic, presence: true

  def version
    self.content.version
  end

end

- (Integer) otu_id

TODO:

Returns:

  • (Integer)


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

class PublicContent < ApplicationRecord
  include Housekeeping

  belongs_to :otu
  belongs_to :topic
  belongs_to :content

  validates_presence_of :text
  validates :topic, presence: true

  def version
    self.content.version
  end

end

- (Integer) project_id

the project ID

Returns:

  • (Integer)


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

class PublicContent < ApplicationRecord
  include Housekeeping

  belongs_to :otu
  belongs_to :topic
  belongs_to :content

  validates_presence_of :text
  validates :topic, presence: true

  def version
    self.content.version
  end

end

- (String) text

TODO:

Returns:

  • (String)


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

class PublicContent < ApplicationRecord
  include Housekeeping

  belongs_to :otu
  belongs_to :topic
  belongs_to :content

  validates_presence_of :text
  validates :topic, presence: true

  def version
    self.content.version
  end

end

- (Integer) topic_id

TODO:

Returns:

  • (Integer)


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

class PublicContent < ApplicationRecord
  include Housekeeping

  belongs_to :otu
  belongs_to :topic
  belongs_to :content

  validates_presence_of :text
  validates :topic, presence: true

  def version
    self.content.version
  end

end

Instance Method Details

- (Object) version



36
37
38
# File 'app/models/public_content.rb', line 36

def version
  self.content.version
end