Class: Trackback
Overview
Legacy class to support old feedback sent as trackbacks.
Instance Attribute Summary
Attributes included from ContentBase
#just_changed_published_status
Instance Method Summary
collapse
Methods inherited from Feedback
#akismet_is_spam?, #akismet_options, allowed_tags, #article_allows_this_feedback, #change_state!, #classify, #classify_content, #confirm_classification, #confirm_classification!, #correct_url, #feedback_not_closed, #html_postprocess, paginated, #parent, #permalink_url, #published?, #report_as_ham, #report_as_spam, #send_notifications, #sp_is_spam?, #spam_fields, #spammy?, #status_confirmed?
#default_text_filter, #excerpt_text, #generate_html, #html, #html_map, #html_postprocess, #html_preprocess, included, #really_send_notifications, #send_notification_to_user, #text_filter
#create_guid
Instance Method Details
#article_allows_feedback? ⇒ Boolean
17
18
19
20
21
22
|
# File 'app/models/trackback.rb', line 17
def article_allows_feedback?
return true if article.allow_pings?
errors.add(:article, "Article is not pingable")
false
end
|
#blog_allows_feedback? ⇒ Boolean
24
25
26
27
28
29
|
# File 'app/models/trackback.rb', line 24
def blog_allows_feedback?
return true unless blog.global_pings_disable
errors.add(:base, "Pings are disabled")
false
end
|
#body ⇒ Object
39
40
41
|
# File 'app/models/trackback.rb', line 39
def body
excerpt
end
|
#body=(newval) ⇒ Object
43
44
45
|
# File 'app/models/trackback.rb', line 43
def body=(newval)
self.excerpt = newval
end
|
#check_article_closed_for_feedback ⇒ Object
31
32
33
|
# File 'app/models/trackback.rb', line 31
def check_article_closed_for_feedback
errors.add(:article, "Pings are closed") if article.pings_closed?
end
|
#feed_title ⇒ Object
47
48
49
|
# File 'app/models/trackback.rb', line 47
def feed_title
"Trackback from #{blog_name}: #{title} on #{article.title}"
end
|
#originator ⇒ Object
35
36
37
|
# File 'app/models/trackback.rb', line 35
def originator
blog_name
end
|
#process_trackback ⇒ Object
10
11
12
13
14
15
|
# File 'app/models/trackback.rb', line 10
def process_trackback
if excerpt.length >= 251
self.excerpt = excerpt[0..246] << "..."
end
end
|