Commit c31ddfe5

mo khan <mo@mokhan.ca>
2013-07-02 02:05:31
fix broken specs
1 parent 282e001
app/models/creation.rb
@@ -1,6 +1,6 @@
 class Creation < ActiveRecord::Base
   include PublicActivity::Model
-  tracked owner: Proc.new{ |controller, model| controller.current_user }
+  tracked owner: Proc.new{ |controller, model| controller.current_user if controller }
   acts_as_commentable
   validates :name,  :presence => true
   attr_accessible :user_id, :story, :name, :category_ids, :is_restricted, :watermark
app/models/favorite.rb
@@ -1,6 +1,6 @@
 class Favorite < ActiveRecord::Base
   include PublicActivity::Model
-  tracked owner: Proc.new{ |controller, model| controller.current_user }
+  tracked owner: Proc.new{ |controller, model| controller.current_user if controller }
   belongs_to :user
   belongs_to :creation, :counter_cache => true
   attr_accessible :user_id, :creation_id
app/models/photo.rb
@@ -1,6 +1,6 @@
 class Photo < ActiveRecord::Base
   include PublicActivity::Model
-  tracked owner: Proc.new{ |controller, model| model.creation.user }
+  tracked owner: Proc.new{ |controller, model| controller.current_user if controller }
   attr_accessible :is_primary, :creation, :image
   belongs_to :creation, :counter_cache => true
   validates :image,  :presence => true
app/models/tutorial.rb
@@ -1,6 +1,6 @@
 class Tutorial < ActiveRecord::Base
   include PublicActivity::Model
-  tracked
+  tracked owner: Proc.new{ |controller, model| controller.current_user }
   attr_accessible :description, :heading, :url, :image_url, :user_id, :author, :author_url
   validates :url,  :presence => true
   belongs_to :user