public
Description: This contains various plugins for Feather
Clone URL: git://github.com/eldiablo/feather-plugins.git
Search Repo:
Click here to lend your support to: feather-plugins and make a donation at www.pledgie.com !
Put in comment activity on the dashboard when a new comment is posted.
mleung (author)
Fri May 09 16:58:16 -0700 2008
commit  2b9d9a025b029257ece4a15b2dc844da5e927c1e
tree    a9663cef9915f13f7468872f8a0b0c84ab1aa4d5
parent  61e7f41da5aae4a11ce56561a1177886e8348690
...
8
9
10
 
 
11
12
13
14
15
16
 
17
18
19
...
29
30
31
 
 
 
 
 
32
33
34
...
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
32
33
34
35
36
37
38
39
40
41
42
0
@@ -8,12 +8,15 @@
0
   property :formatter, :string, :default => "default"
0
   property :ip_address, :string, :default => "127.0.0.1"
0
   property :published, :boolean, :default => true
0
+
0
+ belongs_to :article
0
 
0
   validates_presence_of :name, :comment, :article_id
0
 
0
   before_save :prepend_http_if_needed
0
   belongs_to :article
0
   after_save :fire_after_comment_event
0
+ after_create :set_create_activity
0
 
0
   def self.all_for_post(article_id, method = :all)
0
     self.send(method, {:article_id => article_id, :published => true, :order => "created_at"})
0
@@ -29,6 +32,11 @@
0
     protocol = "http://"
0
      self.website.insert(0, protocol) if self.website.rindex(protocol).nil? && !self.website.empty?
0
     self.website.strip!
0
+ end
0
+
0
+ def set_create_activity
0
+ # This is lame, but for some reason the association (self.article) isn't available yet.
0
+ a = Activity.create(:message => "Comment created by \"#{self.name}\" on #{Article[self.article_id].title}")
0
   end
0
   
0
 end

Comments

    No one has commented yet.