diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 834b333954062afd31521af3942daaf4b067347e..0dae8e54e567d598ab6eb80dd3bcb3836c7f9813 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -9,7 +9,9 @@ class DashboardController < ApplicationController def receive - store_posts_from_xml CGI::unescape(params[:xml]) + xml = CGI::unescape(params[:xml]) + puts xml + store_posts_from_xml xml render :nothing => true end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ce2847aa0a7d690ed9ac13cc7d30c66e19fce048..2865c34762b649739a80ce96c3a21d503c94778f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -67,7 +67,7 @@ module ApplicationHelper when "User" user_path(person) else - "#" + link_to "unknown person", "#" end end diff --git a/app/models/post.rb b/app/models/post.rb index 6a450ebac41ba2d64db96c933c49c44062282c31..0aba899181674a9ecc28a0f8497e311775409c2d 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -25,10 +25,6 @@ class Post Post.sort(:created_at.desc).all end - def each - yield self - end - def self.newest(person = nil) return self.last if person.nil? diff --git a/lib/message_handler.rb b/lib/message_handler.rb index 7d75ce08c14f8432a1d94611778fe6d045b52c38..6fb15dfbee3f9b761cc963f9f997f82aae105b7c 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -25,7 +25,7 @@ class MessageHandler case query.type when :post http = EventMachine::HttpRequest.new(query.destination).post :timeout => TIMEOUT, :body =>{:xml => query.body} - http.callback { process} + http.callback {puts query.inspect; process} when :get http = EventMachine::HttpRequest.new(query.destination).get :timeout => TIMEOUT http.callback {send_to_seed(query, http.response); process}