1
2
3
4
# dynamically define the methods to get/set based on percent complete for both the
# actual and planned values
methods = { :planned => 'complete', :actual => 'completed' }
...

Ruby On Same methods, different Act...

by Chris W., January 09, 2008 01:39

Here is the final version I...

Avatar Talk
1
2
3
4
  def planned_percent_complete
    if self.planned_complete_in_dollars != nil
      (( self.planned_complete_in_dollars.to_f / self.task.budget.to_f )  * 100).round(2)
...

Ruby Same methods, different Act...

by Chris W., January 08, 2008 18:31, 6 refactorings, tagged with ruby, rails, activerecord, dry

I know there has to be a "r...

Avatar Talk