From 2f6857d2c6b57cdc831df698e142f386d4f3e975 Mon Sep 17 00:00:00 2001 From: Tom Cocca Date: Sun, 16 Oct 2011 17:35:19 -0400 Subject: [PATCH] whitespace cleanup --- lib/acts_as_follower.rb | 4 +--- lib/acts_as_follower/follow_scopes.rb | 4 +--- lib/acts_as_follower/followable.rb | 1 - lib/acts_as_follower/follower_lib.rb | 6 +++--- lib/acts_as_follower/railtie.rb | 6 +++--- lib/generators/templates/model.rb | 6 +++--- 6 files changed, 11 insertions(+), 16 deletions(-) diff --git a/lib/acts_as_follower.rb b/lib/acts_as_follower.rb index 94e0bae..c9246b2 100644 --- a/lib/acts_as_follower.rb +++ b/lib/acts_as_follower.rb @@ -5,8 +5,6 @@ module ActsAsFollower autoload :Followable, 'acts_as_follower/followable' autoload :FollowerLib, 'acts_as_follower/follower_lib' autoload :FollowScopes, 'acts_as_follower/follow_scopes' - + require 'acts_as_follower/railtie' if defined?(Rails) && Rails::VERSION::MAJOR >= 3 end - - diff --git a/lib/acts_as_follower/follow_scopes.rb b/lib/acts_as_follower/follow_scopes.rb index ae3ddbd..6917132 100644 --- a/lib/acts_as_follower/follow_scopes.rb +++ b/lib/acts_as_follower/follow_scopes.rb @@ -1,7 +1,6 @@ module ActsAsFollower #:nodoc: module FollowScopes - # Scopes def for_follower(follower) where(:follower_id => follower.id, :follower_type => parent_class_name(follower)) end @@ -33,7 +32,6 @@ def unblocked def blocked where(:blocked => true) end - # end Scopes - + end end diff --git a/lib/acts_as_follower/followable.rb b/lib/acts_as_follower/followable.rb index 019545c..3bd564a 100644 --- a/lib/acts_as_follower/followable.rb +++ b/lib/acts_as_follower/followable.rb @@ -13,7 +13,6 @@ def acts_as_followable end end - module InstanceMethods # Returns the number of followers a record has. diff --git a/lib/acts_as_follower/follower_lib.rb b/lib/acts_as_follower/follower_lib.rb index 3c1e128..5a57806 100644 --- a/lib/acts_as_follower/follower_lib.rb +++ b/lib/acts_as_follower/follower_lib.rb @@ -1,8 +1,8 @@ module ActsAsFollower module FollowerLib - + private - + # Retrieves the parent class name if using STI. def parent_class_name(obj) if obj.class.superclass != ActiveRecord::Base @@ -10,6 +10,6 @@ def parent_class_name(obj) end return obj.class.name end - + end end diff --git a/lib/acts_as_follower/railtie.rb b/lib/acts_as_follower/railtie.rb index f9f0f8e..06aed54 100644 --- a/lib/acts_as_follower/railtie.rb +++ b/lib/acts_as_follower/railtie.rb @@ -3,13 +3,13 @@ module ActsAsFollower class Railtie < Rails::Railtie - + initializer "acts_as_follower.active_record" do |app| ActiveSupport.on_load :active_record do include ActsAsFollower::Follower include ActsAsFollower::Followable end end - + end -end \ No newline at end of file +end diff --git a/lib/generators/templates/model.rb b/lib/generators/templates/model.rb index 7378734..d37f214 100644 --- a/lib/generators/templates/model.rb +++ b/lib/generators/templates/model.rb @@ -2,13 +2,13 @@ class Follow < ActiveRecord::Base extend ActsAsFollower::FollowerLib extend ActsAsFollower::FollowScopes - + # NOTE: Follows belong to the "followable" interface, and also to followers belongs_to :followable, :polymorphic => true belongs_to :follower, :polymorphic => true - + def block! self.update_attribute(:blocked, true) end - + end