Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 15
- Log:
Attempt to update Typo to a Typo SVN HEAD release from around the
time the prototype installation was set up on the RISC OS Open Limited
web site. Timestamps place this at 04-Jul so a revision from 05-Jul or
earlier was pulled and copied over the 2.6.0 tarball stable code.
- Author:
- adh
- Date:
- Sat Jul 22 23:27:35 +0100 2006
- Size:
- 1183 Bytes
1 | require_dependency 'spam_protection' |
2 | |
3 | class Trackback < Content |
4 | include TypoGuid |
5 | belongs_to :article, :counter_cache => true |
6 | |
7 | content_fields :excerpt |
8 | |
9 | validates_age_of :article_id |
10 | validates_against_spamdb :title, :excerpt, :ip, :url |
11 | validates_presence_of :title, :excerpt, :url |
12 | validate_on_create :article_is_pingable |
13 | |
14 | def self.default_order |
15 | 'created_at ASC' |
16 | end |
17 | |
18 | def initialize(*args, &block) |
19 | super(*args, &block) |
20 | self.title ||= self.url |
21 | self.blog_name ||= "" |
22 | end |
23 | |
24 | def location(anchor=:ignored, only_path=true) |
25 | blog.url_for(article, "trackback-#{id}", only_path) |
26 | end |
27 | |
28 | protected |
29 | before_create :make_nofollow, :process_trackback, :create_guid |
30 | |
31 | def make_nofollow |
32 | self.blog_name = blog_name.strip_html |
33 | self.title = title.strip_html |
34 | self.excerpt = excerpt.strip_html |
35 | end |
36 | |
37 | def process_trackback |
38 | if excerpt.length >= 251 |
39 | # this limits excerpt to 250 chars, including the trailing "..." |
40 | self.excerpt = excerpt[0..246] << "..." |
41 | end |
42 | end |
43 | |
44 | def article_is_pingable |
45 | return if article.nil? |
46 | unless article.allow_pings? |
47 | errors.add(:article, "Article is not pingable") |
48 | end |
49 | end |
50 | end |
51 |