# 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...

D41d8cd98f00b204e9800998ecf8427e Talk
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 rails, ruby, activerecord, dry

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

D41d8cd98f00b204e9800998ecf8427e Talk