Skip to content
Browse files

Merge branch 'master' of git://github.com/ivey/feather into ivey/master

  • Loading branch information...
2 parents b046b68 + 7bc4c5b commit 25a0b3710ed0bafdfadd10ec29030f0aa76efc4f El Draper committed Jun 24, 2008
Showing with 9 additions and 17 deletions.
  1. +9 −17 app/models/article.rb
View
26 app/models/article.rb
@@ -20,7 +20,7 @@ class Article
belongs_to :user
# Core filters
- before :update, :set_published_permalink
+ before :save, :set_published_permalink
after :create, :set_create_activity
after :update, :set_update_activity
@@ -47,25 +47,19 @@ def set_published_permalink
end
def set_create_activity
- if new_record?
- a = Activity.new
- a.message = "Article \"#{self.title}\" created"
- a.save
- end
+ a = Activity.new
+ a.message = "Article \"#{self.title}\" created"
+ a.save
end
def set_update_activity
- unless new_record?
- a = Activity.new
- a.message = "Article \"#{self.title}\" updated"
- a.save
- end
+ a = Activity.new
+ a.message = "Article \"#{self.title}\" updated"
+ a.save
end
def fire_before_create_event
- if new_record?
- Hooks::Events.before_create_article(self)
- end
+ Hooks::Events.before_create_article(self)
end
def fire_before_update_event
@@ -78,9 +72,7 @@ def fire_before_save_event
end
def fire_after_create_event
- if new_record?
- Hooks::Events.after_create_article(self)
- end
+ Hooks::Events.after_create_article(self)
end
def fire_after_update_event

0 comments on commit 25a0b37

Please sign in to comment.
Something went wrong with that request. Please try again.