use new model to handle updating of recurring todos

This commit is contained in:
Reinier Balt 2014-02-03 10:48:21 +01:00
parent 00af159be7
commit c2c67f1640
12 changed files with 166 additions and 104 deletions

View file

@ -7,16 +7,11 @@ module RecurringTodos
@pattern = WeeklyRepeatPattern.new(user, @filterred_attributes)
end
def filter_attributes(attributes)
@filterred_attributes = filter_generic_attributes(attributes)
weekly_attributes = %w{weekly_selector weekly_every_x_week}
%w{monday tuesday wednesday thursday friday saturday sunday}.each{|day| weekly_attributes << "weekly_return_#{day}"}
weekly_attributes.each{|key| @filterred_attributes[key] = attributes[key] if attributes.key?(key)}
@filterred_attributes
def attributes_to_filter
%w{weekly_selector weekly_every_x_week} + %w{monday tuesday wednesday thursday friday saturday sunday}.map{|day| "weekly_return_#{day}" }
end
end
end