ryanjm / rails-event-manager

Repeating schedule manager Rails.
MIT License
0 stars 0 forks source link

More robust programming - frequency_length #10

Open ryanjm opened 10 years ago

ryanjm commented 10 years ago

Figure out how to properly handle frequency_length.

    def frequency_length
      if @freq == :daily
        @interval * 1
      elsif @freq == :weekly
        @interval * 7
      elsif @frequency == :monthly
        @interval * 29 # technically this is short, but I think it is fine for now
      end
    end

I'd like something more robust than * 29. Also need to find out a test that will make that fail properly before changing.