Class: PublicContent
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- PublicContent
- 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
-
#content_id ⇒ Integer
Pointer to the working version.
-
#otu_id ⇒ Integer
They Otu.
-
#project_id ⇒ Integer
the project ID.
-
#text ⇒ String
The meat.
-
#topic_id ⇒ Integer
The topic.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Housekeeping
#has_polymorphic_relationship?
Methods inherited from ApplicationRecord
Instance Attribute Details
#content_id ⇒ Integer
Returns pointer to the working version.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/models/public_content.rb', line 25 class PublicContent < ApplicationRecord include Housekeeping belongs_to :otu, inverse_of: :public_contents belongs_to :topic belongs_to :content, inverse_of: :public_content validates_presence_of :text, :topic_id # is general, or always OTU? ignore_whitespace_on(:text) def is_current? content.text == text end def self.is_community? false end end |
#otu_id ⇒ Integer
Returns they Otu.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/models/public_content.rb', line 25 class PublicContent < ApplicationRecord include Housekeeping belongs_to :otu, inverse_of: :public_contents belongs_to :topic belongs_to :content, inverse_of: :public_content validates_presence_of :text, :topic_id # is general, or always OTU? ignore_whitespace_on(:text) def is_current? content.text == text end def self.is_community? false end end |
#project_id ⇒ Integer
the project ID
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/models/public_content.rb', line 25 class PublicContent < ApplicationRecord include Housekeeping belongs_to :otu, inverse_of: :public_contents belongs_to :topic belongs_to :content, inverse_of: :public_content validates_presence_of :text, :topic_id # is general, or always OTU? ignore_whitespace_on(:text) def is_current? content.text == text end def self.is_community? false end end |
#text ⇒ String
Returns the meat.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/models/public_content.rb', line 25 class PublicContent < ApplicationRecord include Housekeeping belongs_to :otu, inverse_of: :public_contents belongs_to :topic belongs_to :content, inverse_of: :public_content validates_presence_of :text, :topic_id # is general, or always OTU? ignore_whitespace_on(:text) def is_current? content.text == text end def self.is_community? false end end |
#topic_id ⇒ Integer
Returns the topic.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/models/public_content.rb', line 25 class PublicContent < ApplicationRecord include Housekeeping belongs_to :otu, inverse_of: :public_contents belongs_to :topic belongs_to :content, inverse_of: :public_content validates_presence_of :text, :topic_id # is general, or always OTU? ignore_whitespace_on(:text) def is_current? content.text == text end def self.is_community? false end end |
Class Method Details
.is_community? ⇒ Boolean
40 41 42 |
# File 'app/models/public_content.rb', line 40 def self.is_community? false end |
Instance Method Details
#is_current? ⇒ Boolean
36 37 38 |
# File 'app/models/public_content.rb', line 36 def is_current? content.text == text end |