mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-13 12:48:51 +01:00
22 lines
No EOL
407 B
Ruby
22 lines
No EOL
407 B
Ruby
module RecurringTodos
|
|
|
|
class AbstractRepeatPattern
|
|
|
|
attr_accessor :attributes
|
|
|
|
def initialize(user)
|
|
@user = user
|
|
end
|
|
|
|
def build_recurring_todo(attributes)
|
|
@recurring_todo = @user.recurring_todos.build(attributes)
|
|
end
|
|
|
|
def update_recurring_todo(recurring_todo, attributes)
|
|
recurring_todo.assign_attributes(attributes)
|
|
recurring_todo
|
|
end
|
|
|
|
end
|
|
|
|
end |