From 0edb06eef7ba54224232b82a46cd69641c76d170 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Wed, 18 Jan 2012 09:29:00 -0800 Subject: [PATCH] fix for the migration for some linux users, which the AR stubs were not carring over from the migration file to the ShareVisibilityConverter --- lib/share_visibility_converter.rb | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/share_visibility_converter.rb b/lib/share_visibility_converter.rb index c8f6dff30..b8b0e7aa1 100644 --- a/lib/share_visibility_converter.rb +++ b/lib/share_visibility_converter.rb @@ -1,3 +1,28 @@ +#we dont have the enviroment, and it is not carring over from the migration +unless defined?(Person) + class Person < ActiveRecord::Base + belongs_to :owner, :class_name => 'User' + end +end + +unless defined?(User) + class User < ActiveRecord::Base + serialize :hidden_shareables, Hash + end +end + +unless defined?(Contact) + class Contact < ActiveRecord::Base + belongs_to :user + end +end + +unless defined?(ShareVisibility) + class ShareVisibility < ActiveRecord::Base + belongs_to :contact + end +end + class ShareVisibilityConverter RECENT = 2 # number of weeks to do in the migration def self.copy_hidden_share_visibilities_to_users(only_recent = false) @@ -21,4 +46,4 @@ class ShareVisibilityConverter end end end -end \ No newline at end of file +end