Created
June 8, 2010 23:44
-
-
Save djanowski/430810 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Report | |
| def update_tipifications(tipifications) | |
| self.tipifications = tipifications | |
| analizar! | |
| save! | |
| end | |
| end | |
| class ReportsController | |
| def save | |
| params[:report].each do |report_id, report_params| | |
| report = Report.find(report_id) | |
| report.priority = Priority.find(report_params[:priority_id]) | |
| report.comments.create! :comment => report_params[:comment], :user => current_user unless report_params[:comment].blank? | |
| report.update_tipifications(report_params[:tipification_ids].map { |id| Tipification.find(id) }) unless report_params[:tipification_ids].empty? | |
| end | |
| redirect_to :action => 'listing' | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment