mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-04 00:08:50 +01:00
use new model to handle updating of recurring todos
This commit is contained in:
parent
00af159be7
commit
c2c67f1640
12 changed files with 166 additions and 104 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue