Browse files

Chore: Moved SlugHistory instance methods out of InstanceMethods module

  • Loading branch information...
1 parent 9fdd55d commit bd30c733f45ae9fcbe23c3f4afd7b1349678d758 @anathematic anathematic committed Feb 17, 2012
Showing with 16 additions and 20 deletions.
  1. +16 −20 lib/slugged/slug_history.rb
View
36 lib/slugged/slug_history.rb
@@ -6,26 +6,22 @@ module SlugHistory
after_save :record_slug_changes
after_destroy :remove_slug_history!
end
-
- module InstanceMethods
-
- def previous_slugs
- Slugged.previous_slugs_for(self)
- end
-
- def remove_slug_history!
- Slugged.remove_slug_history_for(self)
- end
-
- protected
-
- def record_slug_changes
- slug_column = self.cached_slug_column
- return unless send(:"#{slug_column}_changed?")
- value = send(:"#{slug_column}_was")
- Slugged.record_slug(self, value) if value.present?
- end
-
+
+ def previous_slugs
+ Slugged.previous_slugs_for(self)
+ end
+
+ def remove_slug_history!
+ Slugged.remove_slug_history_for(self)
+ end
+
+ protected
+
+ def record_slug_changes
+ slug_column = self.cached_slug_column
+ return unless send(:"#{slug_column}_changed?")
+ value = send(:"#{slug_column}_was")
+ Slugged.record_slug(self, value) if value.present?
end
module ClassMethods

0 comments on commit bd30c73

Please sign in to comment.