Commit a851177bc6ed099536a57a9df08cdf603e84ce61
Committed by
Paulo Meireles
1 parent
370a40f7
Exists in
master
and in
29 other branches
[Mezuro] Trying to solve some errors with the date
Showing
3 changed files
with
6 additions
and
14 deletions
Show diff stats
plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb
... | ... | @@ -26,8 +26,7 @@ class MezuroPluginProfileController < ProfileController |
26 | 26 | def module_result |
27 | 27 | content = profile.articles.find(params[:id]) |
28 | 28 | date = params[:date] |
29 | - project_result = date.nil? ? content.project_result : content.get_date_result(date) | |
30 | - module_result = content.module_result(params[:module_name]) | |
29 | + module_result = content.module_result(params[:module_name], date) | |
31 | 30 | render :partial => 'content_viewer/module_result', :locals => { :module_result => module_result} |
32 | 31 | end |
33 | 32 | |
... | ... | @@ -35,7 +34,6 @@ class MezuroPluginProfileController < ProfileController |
35 | 34 | content = profile.articles.find(params[:id]) |
36 | 35 | date = params[:date] |
37 | 36 | project_result = date.nil? ? content.project_result : content.get_date_result(date) |
38 | - project_result = content.project_result | |
39 | 37 | source_tree = project_result.node_of(params[:module_name]) |
40 | 38 | render :partial =>'content_viewer/source_tree', :locals => { :source_tree => source_tree, :project_name => content.project.name} |
41 | 39 | end | ... | ... |
plugins/mezuro/lib/kalibro/client/module_result_client.rb
... | ... | @@ -16,12 +16,4 @@ class Kalibro::Client::ModuleResultClient |
16 | 16 | {:project_name => project_name, :module_name => module_name})[:module_result] |
17 | 17 | Kalibro::Entities::Entity.new.to_entity_array(value, Kalibro::Entities::ModuleResult) |
18 | 18 | end |
19 | - | |
20 | - private | |
21 | - | |
22 | - def date_with_milliseconds(date) | |
23 | - milliseconds = "." + (date.sec_fraction * 60 * 60 * 24 * 1000).to_s | |
24 | - date.to_s[0..18] + milliseconds + date.to_s[19..-1] | |
25 | - end | |
26 | - | |
27 | 19 | end | ... | ... |
plugins/mezuro/lib/mezuro_plugin/project_content.rb
... | ... | @@ -34,9 +34,11 @@ class MezuroPlugin::ProjectContent < Article |
34 | 34 | @project_result ||= client.has_results_before(name, date) ? client.last_result_before(name, date) : client.first_result_after(name, date) |
35 | 35 | end |
36 | 36 | |
37 | - def module_result(module_name) | |
38 | - module_name = project.name if module_name.nil? | |
39 | - @module_client ||= module_result_client.module_result(project.name, module_name, project_result.date) | |
37 | + def module_result(module_name, date) | |
38 | + module_name = project.name if module_name.nil? | |
39 | +#FIXME date format is wrong | |
40 | + date = project_result.date if date.nil? | |
41 | + @module_client ||= module_result_client.module_result(project.name, module_name, date) | |
40 | 42 | end |
41 | 43 | |
42 | 44 | def result_history(module_name) | ... | ... |