starting migrations
This commit is contained in:
parent
a4336a8e72
commit
8fe2eb3180
3 changed files with 23 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
class Services::Twitter < Service
|
class Services::Twitter < Service
|
||||||
MAX_CHARACTERS = 140
|
MAX_CHARACTERS = 140
|
||||||
|
<D-F>url
|
||||||
def post(post, url='')
|
def post(post, url='')
|
||||||
Rails.logger.debug("event=post_to_service type=twitter sender_id=#{self.user_id}")
|
Rails.logger.debug("event=post_to_service type=twitter sender_id=#{self.user_id}")
|
||||||
message = public_message(post, url)
|
message = public_message(post, url)
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,11 @@
|
||||||
require File.join(Rails.root, 'lib/diaspora/user')
|
require File.join(Rails.root, 'lib/diaspora/user')
|
||||||
require File.join(Rails.root, 'lib/salmon/salmon')
|
require File.join(Rails.root, 'lib/salmon/salmon')
|
||||||
require 'rest-client'
|
require 'rest-client'
|
||||||
|
|
||||||
class User
|
class User
|
||||||
include MongoMapper::Document
|
include MongoMapper::Document
|
||||||
include Diaspora::UserModules
|
include Diaspora::UserModules
|
||||||
include Encryptor::Private
|
include Encryptor::Private
|
||||||
include ActionView::Helpers::TextHelper
|
|
||||||
|
|
||||||
plugin MongoMapper::Devise
|
plugin MongoMapper::Devise
|
||||||
|
|
||||||
|
|
|
||||||
21
lib/tasks/migration.rb
Normal file
21
lib/tasks/migration.rb
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
namespace :migration do
|
||||||
|
desc 'make old registered services into the new class specific services'
|
||||||
|
task :service_reclassify do
|
||||||
|
Service.all.each do |s|
|
||||||
|
provider = s.provider
|
||||||
|
s._type = "Services::#{provider.camelize}"
|
||||||
|
s.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
desc 'allow to upgrade old image urls to use rel path'
|
||||||
|
task :swtich_image_urls do
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
desc 'move all posts and photos to new schema'
|
||||||
|
task :migrate_status_message_to_posts do
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Reference in a new issue