Permalink
Browse files

Remove \r before saving contents of config file to db.

  • Loading branch information...
1 parent c6e2677 commit 7aac1629a246f96fb4240678eeb982c2968c1c62 @guanxiaohua2k6 guanxiaohua2k6 committed May 16, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/controllers/proposals_controller.rb
@@ -239,15 +239,13 @@ def _change_params
component_config["component_config_default_id"] = ComponentConfigDefault.find_by_path(component_config["path"]).id
component_config.delete "path"
- component_config["content"].gsub! "\r", ""
}
proposal_hash.fetch("software_configs_attributes", []).each {|index, software_config|
software_config["software_id"] = proposal_hash["software_id"]
software_config["software_config_default_id"] = SoftwareConfigDefault.find_by_path(software_config["path"]).id
software_config.delete "path"
- software_config["content"].gsub! "\r", ""
}
logger.debug proposal_hash.inspect
@@ -279,12 +277,14 @@ def _strip_contents_in_params
if params[:proposal].has_key? :software_configs_attributes
params[:proposal][:software_configs_attributes].each do |key, software_config_attr|
software_config_attr[:content].strip!
+ software_config_attr[:content].gsub! "\r", ""
end
end
if params[:proposal].has_key? :component_configs_attributes
params[:proposal][:component_configs_attributes].each do |key, component_config_attr|
component_config_attr[:content].strip!
+ component_config_attr[:content].gsub! "\r", ""
end
end
end

0 comments on commit 7aac162

Please sign in to comment.