Push to_xml_params down to ApplicationController

This commit is contained in:
Matt Rogers 2013-04-30 22:50:32 -05:00
parent 98b188d1df
commit 8fe343cccc
3 changed files with 8 additions and 16 deletions

View file

@ -256,4 +256,12 @@ class ApplicationController < ActionController::Base
@z_index_counter = 500
end
def to_xml_params
if params[:limit_fields] == 'index'
return [:only => [:id, :created_at, :updated_at, :completed_at] ]
else
return [:except => :user_id, :include => [:tags, :predecessors, :successors] ]
end
end
end

View file

@ -21,12 +21,4 @@ class CalendarController < ApplicationController
}
end
end
def to_xml_params
if params[:limit_fields] == 'index'
return [:only => [:id, :created_at, :updated_at, :completed_at] ]
else
return [:except => :user_id, :include => [:tags, :predecessors, :successors] ]
end
end
end

View file

@ -815,14 +815,6 @@ class TodosController < ApplicationController
end
end
def to_xml_params
if params[:limit_fields] == 'index'
return [:only => [:id, :created_at, :updated_at, :completed_at] ]
else
return [:except => :user_id, :include => [:tags, :predecessors, :successors] ]
end
end
def get_todo_from_params
# TODO: this was a :append_before but was removed to tune performance per
# method. Reconsider re-enabling it