From b23338eaa29cccb79c67c75dc8f6d8640047d2f8 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Mon, 10 Feb 2014 11:45:25 +0100 Subject: [PATCH] fix updating of recurring todo and create a form helper for filling the recurring todo edit form --- .../recurring_todos/form_helper.rb | 50 ++++++++++ app/controllers/recurring_todos_controller.rb | 21 ++-- app/models/recurring_todo.rb | 8 -- .../abstract_recurring_todos_builder.rb | 21 +++- .../abstract_repeat_pattern.rb | 4 +- .../recurring_todos/monthly_repeat_pattern.rb | 8 ++ .../recurring_todos_builder.rb | 4 +- app/views/recurring_todos/_edit_form.html.erb | 96 +++++++++---------- lib/tracks/attribute_handler.rb | 26 ++++- 9 files changed, 166 insertions(+), 72 deletions(-) create mode 100644 app/controllers/recurring_todos/form_helper.rb diff --git a/app/controllers/recurring_todos/form_helper.rb b/app/controllers/recurring_todos/form_helper.rb new file mode 100644 index 00000000..0a81f08d --- /dev/null +++ b/app/controllers/recurring_todos/form_helper.rb @@ -0,0 +1,50 @@ +module RecurringTodos + + class FormHelper + + def initialize(recurring_todo) + @recurring_todo = recurring_todo + end + + def create_pattern(pattern_class) + pattern = pattern_class.new(@recurring_todo.user) + pattern.build_from_recurring_todo(@recurring_todo) + pattern + end + + def daily_pattern + @daily_pattern ||= create_pattern(DailyRepeatPattern) + end + + def weekly_pattern + @weekly_pattern ||= create_pattern(WeeklyRepeatPattern) + end + + def monthly_pattern + @monthly_pattern ||= create_pattern(MonthlyRepeatPattern) + end + + def yearly_pattern + @yearly_pattern ||= create_pattern(YearlyRepeatPattern) + end + + def method_missing(method, *args) + if method.to_s =~ /^daily_(.+)$/ + daily_pattern.send($1, *args) + elsif method.to_s =~ /^weekly_(.+)$/ + weekly_pattern.send($1, *args) + elsif method.to_s =~ /^monthly_(.+)$/ + monthly_pattern.send($1, *args) + elsif method.to_s =~ /^yearly_(.+)$/ + yearly_pattern.send($1, *args) + elsif method.to_s =~ /^on_(.+)$/ # on_monday, on_tuesday, etc. + weekly_pattern.send(method, *args) + else + # no match, let @recurring_todo handle it, or fail + @recurring_todo.send(method, *args) + end + end + + end + +end \ No newline at end of file diff --git a/app/controllers/recurring_todos_controller.rb b/app/controllers/recurring_todos_controller.rb index 20461e05..a15f6922 100644 --- a/app/controllers/recurring_todos_controller.rb +++ b/app/controllers/recurring_todos_controller.rb @@ -37,13 +37,15 @@ class RecurringTodosController < ApplicationController end def edit + @form_helper = RecurringTodos::FormHelper.new(@recurring_todo) + respond_to do |format| format.js end end def update - updater = RecurringTodos::RecurringTodosBuilder.new(current_user, edit_recurring_todo_params) + updater = RecurringTodos::RecurringTodosBuilder.new(current_user, update_recurring_todo_params) @saved = updater.update(@recurring_todo) @recurring_todo.reload @@ -162,23 +164,29 @@ class RecurringTodosController < ApplicationController def all_recurring_todo_params # move context_name, project_name and tag_list into :recurring_todo hash for easier processing - { context_name: :context_name, project_name: :project_name, tag_list: :tag_list}.each do |target,source| + { + context_name: :context_name, + project_name: :project_name, + tag_list: :tag_list + }.each do |target,source| move_into_recurring_todo_param(params, target, source) end recurring_todo_params end - def edit_recurring_todo_params + def update_recurring_todo_params # we needed to rename the recurring_period selector in the edit form because # the form for a new recurring todo and the edit form are on the same page. # Same goes for start_from and end_date params['recurring_todo']['recurring_period'] = params['recurring_edit_todo']['recurring_period'] - { context_name: :context_name, + { + context_name: :context_name, project_name: :project_name, tag_list: :edit_recurring_todo_tag_list, end_date: :recurring_todo_edit_end_date, - start_from: :recurring_todo_edit_start_from}.each do |target,source| + start_from: :recurring_todo_edit_start_from + }.each do |target,source| move_into_recurring_todo_param(params, target, source) end @@ -187,7 +195,8 @@ class RecurringTodosController < ApplicationController %w{monday tuesday wednesday thursday friday saturday sunday}.each do |day| params["recurring_todo"]["weekly_return_#{day}"]=' ' if params["recurring_todo"]["weekly_return_#{day}"].nil? end - params['recurring_todo'] + + recurring_todo_params end def move_into_recurring_todo_param(params, target, source) diff --git a/app/models/recurring_todo.rb b/app/models/recurring_todo.rb index 9fa34198..b731e697 100644 --- a/app/models/recurring_todo.rb +++ b/app/models/recurring_todo.rb @@ -101,14 +101,6 @@ class RecurringTodo < ActiveRecord::Base end end - def recurring_show_days_before=(days) - self.show_from_delta=days - end - - def recurring_show_always=(value) - self.show_always=value - end - def daily_recurrence_pattern if only_work_days I18n.t("todos.recurrence.pattern.on_work_days") diff --git a/app/models/recurring_todos/abstract_recurring_todos_builder.rb b/app/models/recurring_todos/abstract_recurring_todos_builder.rb index e2d610e7..fd61bcc4 100644 --- a/app/models/recurring_todos/abstract_recurring_todos_builder.rb +++ b/app/models/recurring_todos/abstract_recurring_todos_builder.rb @@ -22,15 +22,10 @@ module RecurringTodos def build @recurring_todo = @pattern.build_recurring_todo(@mapped_attributes) - @recurring_todo.context = @filterred_attributes.get(:context) - @recurring_todo.project = @filterred_attributes.get(:project) end def update(recurring_todo) @recurring_todo = @pattern.update_recurring_todo(recurring_todo, @mapped_attributes) - @recurring_todo.context = @filterred_attributes.get(:context) - @recurring_todo.project = @filterred_attributes.get(:project) - @saved = @recurring_todo.save @recurring_todo.tag_with(@filterred_attributes.get(:tag_list)) if @saved && @filterred_attributes.get(:tag_list).present? @recurring_todo.reload @@ -45,6 +40,22 @@ module RecurringTodos return @saved end + def save_collection(collection, collection_id) + # save object (project or context) and add its id to @mapped_attributes and remove the object from the attributes + object = @mapped_attributes.get(collection) + object.save + @mapped_attributes.set(collection_id, object.id) + @mapped_attributes.except(collection) + end + + def save_project + save_collection(:project, :project_id) + end + + def save_context + save_collection(:context, :context_id) + end + def saved_recurring_todo raise(Exception.new, @recurring_todo.valid? ? "Recurring todo was not saved yet" : "Recurring todos was not saved because of validation errors") unless @saved diff --git a/app/models/recurring_todos/abstract_repeat_pattern.rb b/app/models/recurring_todos/abstract_repeat_pattern.rb index cf2f6a76..93bc3fef 100644 --- a/app/models/recurring_todos/abstract_repeat_pattern.rb +++ b/app/models/recurring_todos/abstract_repeat_pattern.rb @@ -33,11 +33,11 @@ module RecurringTodos end def build_recurring_todo(attribute_handler) - @recurring_todo = @user.recurring_todos.build(attribute_handler.attributes) + @recurring_todo = @user.recurring_todos.build(attribute_handler.safe_attributes) end def update_recurring_todo(recurring_todo, attribute_handler) - recurring_todo.assign_attributes(attribute_handler.attributes) + recurring_todo.assign_attributes(attribute_handler.safe_attributes) recurring_todo end diff --git a/app/models/recurring_todos/monthly_repeat_pattern.rb b/app/models/recurring_todos/monthly_repeat_pattern.rb index 3561ba60..aa901b4a 100644 --- a/app/models/recurring_todos/monthly_repeat_pattern.rb +++ b/app/models/recurring_todos/monthly_repeat_pattern.rb @@ -14,10 +14,18 @@ module RecurringTodos get(:recurrence_selector) == 0 end + def every_x_day + get(:every_other1) + end + def every_xth_day? get(:recurrence_selector) == 1 end + def every_xth_day + get :every_other2 + end + def every_x_month # in case monthly pattern is every day x, return every_other2 otherwise # return a default value diff --git a/app/models/recurring_todos/recurring_todos_builder.rb b/app/models/recurring_todos/recurring_todos_builder.rb index 569baa3d..dd26e637 100644 --- a/app/models/recurring_todos/recurring_todos_builder.rb +++ b/app/models/recurring_todos/recurring_todos_builder.rb @@ -32,8 +32,8 @@ module RecurringTodos end def save - @project.save if @new_project_created - @context.save if @new_context_created + @builder.save_project if @new_project_created + @builder.save_context if @new_context_created return @builder.save end diff --git a/app/views/recurring_todos/_edit_form.html.erb b/app/views/recurring_todos/_edit_form.html.erb index dfb94095..21c4ab24 100644 --- a/app/views/recurring_todos/_edit_form.html.erb +++ b/app/views/recurring_todos/_edit_form.html.erb @@ -5,91 +5,91 @@
<%= - text_field_tag( "recurring_todo[description]", @recurring_todo.description, "size" => 30, "maxlength" => 100, :id => "edit_recurring_todo_description") -%> + text_field_tag( "recurring_todo[description]", @form_helper.description, "size" => 30, "maxlength" => 100, :id => "edit_recurring_todo_description") -%> <%= - text_area_tag( "recurring_todo[notes]", @recurring_todo.notes, {:cols => 29, :rows => 6}) -%> + text_area_tag( "recurring_todo[notes]", @form_helper.notes, {:cols => 29, :rows => 6}) -%> - " /> + " /> - + - <%= text_field_tag "edit_recurring_todo_tag_list", @recurring_todo.tag_list, :size => 30 -%> + <%= text_field_tag "edit_recurring_todo_tag_list", @form_helper.tag_list, :size => 30 -%>

- <%= radio_button_tag('recurring_edit_todo[recurring_period]', 'daily', @recurring_todo.recurring_period == 'daily')%> <%= t('todos.recurrence.daily') %>
- <%= radio_button_tag('recurring_edit_todo[recurring_period]', 'weekly', @recurring_todo.recurring_period == 'weekly')%> <%= t('todos.recurrence.weekly') %>
- <%= radio_button_tag('recurring_edit_todo[recurring_period]', 'monthly', @recurring_todo.recurring_period == 'monthly')%> <%= t('todos.recurrence.monthly') %>
- <%= radio_button_tag('recurring_edit_todo[recurring_period]', 'yearly', @recurring_todo.recurring_period == 'yearly')%> <%= t('todos.recurrence.yearly') %>
+ <%= radio_button_tag('recurring_edit_todo[recurring_period]', 'daily', @form_helper.recurring_period == 'daily')%> <%= t('todos.recurrence.daily') %>
+ <%= radio_button_tag('recurring_edit_todo[recurring_period]', 'weekly', @form_helper.recurring_period == 'weekly')%> <%= t('todos.recurrence.weekly') %>
+ <%= radio_button_tag('recurring_edit_todo[recurring_period]', 'monthly', @form_helper.recurring_period == 'monthly')%> <%= t('todos.recurrence.monthly') %>
+ <%= radio_button_tag('recurring_edit_todo[recurring_period]', 'yearly', @form_helper.recurring_period == 'yearly')%> <%= t('todos.recurrence.yearly') %>

<%= - text_field_tag("recurring_todo_edit_start_from", format_date(@recurring_todo.start_from), "size" => 12, "class" => "Date", "autocomplete" => "off") %>
+ text_field_tag("recurring_todo_edit_start_from", format_date(@form_helper.start_from), "size" => 12, "class" => "Date", "autocomplete" => "off") %>


- <%= radio_button_tag('recurring_todo[ends_on]', 'no_end_date', @recurring_todo.ends_on == 'no_end_date')%> <%= t('todos.recurrence.no_end_date') %>
- <%= radio_button_tag('recurring_todo[ends_on]', 'ends_on_number_of_times', @recurring_todo.ends_on == 'ends_on_number_of_times')%> + <%= radio_button_tag('recurring_todo[ends_on]', 'no_end_date', @form_helper.ends_on == 'no_end_date')%> <%= t('todos.recurrence.no_end_date') %>
+ <%= radio_button_tag('recurring_todo[ends_on]', 'ends_on_number_of_times', @form_helper.ends_on == 'ends_on_number_of_times')%> <%= raw t('todos.recurrence.ends_on_number_times', :number => text_field( :recurring_todo, :number_of_occurences, "size" => 3)) %>
- <%= radio_button_tag('recurring_todo[ends_on]', 'ends_on_end_date', @recurring_todo.ends_on == 'ends_on_end_date')%> - <%= raw t('todos.recurrence.ends_on_date', :date => text_field_tag('recurring_todo_edit_end_date', format_date(@recurring_todo.end_date), "size" => 12, "class" => "Date", "autocomplete" => "off")) %>
+ <%= radio_button_tag('recurring_todo[ends_on]', 'ends_on_end_date', @form_helper.ends_on == 'ends_on_end_date')%> + <%= raw t('todos.recurrence.ends_on_date', :date => text_field_tag('recurring_todo_edit_end_date', format_date(@form_helper.end_date), "size" => 12, "class" => "Date", "autocomplete" => "off")) %>
-
+

- <%= radio_button_tag('recurring_todo[daily_selector]', 'daily_every_x_day', !@recurring_todo.only_work_days)%> - <%= raw t('todos.recurrence.daily_every_number_day', :number=> text_field_tag( 'recurring_todo[daily_every_x_days]', @recurring_todo.daily_every_x_days, {"size" => 3})) %>
- <%= radio_button_tag('recurring_todo[daily_selector]', 'daily_every_work_day', @recurring_todo.only_work_days)%> <%= t('todos.recurrence.every_work_day') %>
+ <%= radio_button_tag('recurring_todo[daily_selector]', 'daily_every_x_day', !@form_helper.only_work_days)%> + <%= raw t('todos.recurrence.daily_every_number_day', :number=> text_field_tag( 'recurring_todo[daily_every_x_days]', @form_helper.daily_every_x_days, {"size" => 3})) %>
+ <%= radio_button_tag('recurring_todo[daily_selector]', 'daily_every_work_day', @form_helper.only_work_days)%> <%= t('todos.recurrence.every_work_day') %>
-
+

- <%= raw t('todos.recurrence.weekly_every_number_week', :number => text_field_tag('recurring_todo[weekly_every_x_week]', @recurring_todo.weekly_every_x_week, {"size" => 3})) %>
- <%= check_box_tag('recurring_todo[weekly_return_monday]', 'm', @recurring_todo.on_monday ) %> <%= t('date.day_names')[1] %> - <%= check_box_tag('recurring_todo[weekly_return_tuesday]', 't', @recurring_todo.on_tuesday) %> <%= t('date.day_names')[2] %> - <%= check_box_tag('recurring_todo[weekly_return_wednesday]', 'w', @recurring_todo.on_wednesday) %> <%= t('date.day_names')[3] %> - <%= check_box_tag('recurring_todo[weekly_return_thursday]', 't', @recurring_todo.on_thursday) %> <%= t('date.day_names')[4] %>
- <%= check_box_tag('recurring_todo[weekly_return_friday]', 'f', @recurring_todo.on_friday) %> <%= t('date.day_names')[5] %> - <%= check_box_tag('recurring_todo[weekly_return_saturday]', 's', @recurring_todo.on_saturday) %> <%= t('date.day_names')[6] %> - <%= check_box_tag('recurring_todo[weekly_return_sunday]', 's', @recurring_todo.on_sunday) %> <%= t('date.day_names')[0] %>
+ <%= raw t('todos.recurrence.weekly_every_number_week', :number => text_field_tag('recurring_todo[weekly_every_x_week]', @form_helper.weekly_every_x_week, {"size" => 3})) %>
+ <%= check_box_tag('recurring_todo[weekly_return_monday]', 'm', @form_helper.on_monday ) %> <%= t('date.day_names')[1] %> + <%= check_box_tag('recurring_todo[weekly_return_tuesday]', 't', @form_helper.on_tuesday) %> <%= t('date.day_names')[2] %> + <%= check_box_tag('recurring_todo[weekly_return_wednesday]', 'w', @form_helper.on_wednesday) %> <%= t('date.day_names')[3] %> + <%= check_box_tag('recurring_todo[weekly_return_thursday]', 't', @form_helper.on_thursday) %> <%= t('date.day_names')[4] %>
+ <%= check_box_tag('recurring_todo[weekly_return_friday]', 'f', @form_helper.on_friday) %> <%= t('date.day_names')[5] %> + <%= check_box_tag('recurring_todo[weekly_return_saturday]', 's', @form_helper.on_saturday) %> <%= t('date.day_names')[6] %> + <%= check_box_tag('recurring_todo[weekly_return_sunday]', 's', @form_helper.on_sunday) %> <%= t('date.day_names')[0] %>
-
+

- <%= radio_button_tag('recurring_todo[monthly_selector]', 'monthly_every_x_day', @recurring_todo.is_monthly_every_x_day || @recurring_todo.recurring_period == 'weekly')%> + <%= radio_button_tag('recurring_todo[monthly_selector]', 'monthly_every_x_day', @form_helper.monthly_every_x_day? || @form_helper.recurring_period == 'weekly')%> <%= raw t('todos.recurrence.day_x_on_every_x_month', - :day => text_field_tag('recurring_todo[monthly_every_x_day]', @recurring_todo.monthly_every_x_day, {"size" => 3}), - :month => text_field_tag('recurring_todo[monthly_every_x_month]', @recurring_todo.monthly_every_x_month, {"size" => 3})) %>
- <%= radio_button_tag('recurring_todo[monthly_selector]', 'monthly_every_xth_day', @recurring_todo.is_monthly_every_xth_day)%> + :day => text_field_tag('recurring_todo[monthly_every_x_day]', @form_helper.monthly_every_x_day, {"size" => 3}), + :month => text_field_tag('recurring_todo[monthly_every_x_month]', @form_helper.monthly_every_x_month, {"size" => 3})) %>
+ <%= radio_button_tag('recurring_todo[monthly_selector]', 'monthly_every_xth_day', @form_helper.monthly_every_xth_day?)%> <%= raw t('todos.recurrence.monthly_every_xth_day', - :day => select_tag('recurring_todo[monthly_every_xth_day]', options_for_select(@xth_day, @xth_day[@recurring_todo.monthly_every_xth_day(1)-1][1])), - :day_of_week => select_tag('recurring_todo[monthly_day_of_week]' , options_for_select(@days_of_week, @recurring_todo.monthly_day_of_week)), - :month => text_field_tag('recurring_todo[monthly_every_x_month2]', @recurring_todo.monthly_every_x_month2, {"size" => 3})) %>
+ :day => select_tag('recurring_todo[monthly_every_xth_day]', options_for_select(@xth_day, @xth_day[@form_helper.monthly_every_xth_day(1)-1][1])), + :day_of_week => select_tag('recurring_todo[monthly_day_of_week]' , options_for_select(@days_of_week, @form_helper.monthly_day_of_week)), + :month => text_field_tag('recurring_todo[monthly_every_x_month2]', @form_helper.monthly_every_x_month2, {"size" => 3})) %>
-
+

- <%= radio_button_tag('recurring_todo[yearly_selector]', 'yearly_every_x_day', @recurring_todo.recurrence_selector == 0)%> + <%= radio_button_tag('recurring_todo[yearly_selector]', 'yearly_every_x_day', @form_helper.recurrence_selector == 0)%> <%= raw t('todos.recurrence.yearly_every_x_day', - :month => select_tag('recurring_todo[yearly_month_of_year]', options_for_select(@months_of_year, @recurring_todo.yearly_month_of_year)), - :day => text_field_tag('recurring_todo[yearly_every_x_day]', @recurring_todo.yearly_every_x_day, "size" => 3)) %>
- <%= radio_button_tag('recurring_todo[yearly_selector]', 'yearly_every_xth_day', @recurring_todo.recurrence_selector == 1)%> + :month => select_tag('recurring_todo[yearly_month_of_year]', options_for_select(@months_of_year, @form_helper.yearly_month_of_year)), + :day => text_field_tag('recurring_todo[yearly_every_x_day]', @form_helper.yearly_every_x_day, "size" => 3)) %>
+ <%= radio_button_tag('recurring_todo[yearly_selector]', 'yearly_every_xth_day', @form_helper.recurrence_selector == 1)%> <%= raw t('todos.recurrence.yearly_every_xth_day', - :day => select_tag('recurring_todo[yearly_every_xth_day]', options_for_select(@xth_day, @recurring_todo.yearly_every_xth_day)), - :day_of_week => select_tag('recurring_todo[yearly_day_of_week]', options_for_select(@days_of_week, @recurring_todo.yearly_day_of_week)), - :month => select_tag('recurring_todo[yearly_month_of_year2]', options_for_select(@months_of_year, @recurring_todo.yearly_month_of_year2))) %>
+ :day => select_tag('recurring_todo[yearly_every_xth_day]', options_for_select(@xth_day, @form_helper.yearly_every_xth_day)), + :day_of_week => select_tag('recurring_todo[yearly_day_of_week]', options_for_select(@days_of_week, @form_helper.yearly_day_of_week)), + :month => select_tag('recurring_todo[yearly_month_of_year2]', options_for_select(@months_of_year, @form_helper.yearly_month_of_year2))) %>

- <%= radio_button_tag('recurring_todo[recurring_target]', 'due_date', @recurring_todo.target == 'due_date')%> <%= t('todos.recurrence.recurrence_on.due_date') %>. <%= t('todos.recurrence.recurrence_on.show_options') %>: - <%= radio_button_tag('recurring_todo[recurring_show_always]', '1', @recurring_todo.show_always?)%> <%= t('todos.recurrence.recurrence_on.show_always') %> - <%= radio_button_tag('recurring_todo[recurring_show_always]', '0', !@recurring_todo.show_always?)%> - <%= raw t('todos.recurrence.recurrence_on.show_days_before', :days => text_field_tag( 'recurring_todo[recurring_show_days_before]', @recurring_todo.show_from_delta, {"size" => 3})) %>
- <%= radio_button_tag('recurring_todo[recurring_target]', 'show_from_date', @recurring_todo.target == 'show_from_date')%> <%= t('todos.recurrence.recurrence_on.from_tickler') %>
+ <%= radio_button_tag('recurring_todo[recurring_target]', 'due_date', @form_helper.target == 'due_date')%> <%= t('todos.recurrence.recurrence_on.due_date') %>. <%= t('todos.recurrence.recurrence_on.show_options') %>: + <%= radio_button_tag('recurring_todo[recurring_show_always]', '1', @form_helper.show_always?)%> <%= t('todos.recurrence.recurrence_on.show_always') %> + <%= radio_button_tag('recurring_todo[recurring_show_always]', '0', !@form_helper.show_always?)%> + <%= raw t('todos.recurrence.recurrence_on.show_days_before', :days => text_field_tag( 'recurring_todo[recurring_show_days_before]', @form_helper.show_from_delta, {"size" => 3})) %>
+ <%= radio_button_tag('recurring_todo[recurring_target]', 'show_from_date', @form_helper.target == 'show_from_date')%> <%= t('todos.recurrence.recurrence_on.from_tickler') %>

<% end %> diff --git a/lib/tracks/attribute_handler.rb b/lib/tracks/attribute_handler.rb index c9901c93..c944b001 100644 --- a/lib/tracks/attribute_handler.rb +++ b/lib/tracks/attribute_handler.rb @@ -42,8 +42,9 @@ module Tracks new_object_created = false if specified_by_name?(object_type) - # find or create context or project by given name object, new_object_created = find_or_create_by_name(relation, name) + # put id of object in @attributes, i.e. set :project_id to project.id + @attributes[object_type.to_s + "_id"] = object.id unless new_object_created else # find context or project by its id object = attribute_with_id_of(object_type).present? ? relation.find(attribute_with_id_of(object_type)) : nil @@ -99,6 +100,29 @@ module Tracks Hash[attributes.map{|k,v| [k.to_sym,v]}] end + def safe_attributes + ActionController::Parameters.new(attributes).permit( + :context, :project, + # model attributes + :context_id, :project_id, :description, :notes, :state, :start_from, + :ends_on, :end_date, :number_of_occurences, :occurences_count, :target, + :show_from_delta, :recurring_period, :recurrence_selector, :every_other1, + :every_other2, :every_other3, :every_day, :only_work_days, :every_count, + :weekday, :show_always, :context_name, :project_name, :tag_list, + # form attributes + :recurring_period, :daily_selector, :monthly_selector, :yearly_selector, + :recurring_target, :daily_every_x_days, :monthly_day_of_week, + :monthly_every_x_day, :monthly_every_x_month2, :monthly_every_x_month, + :monthly_every_xth_day, :recurring_show_days_before, + :recurring_show_always, :weekly_every_x_week, :weekly_return_monday, + :yearly_day_of_week, :yearly_every_x_day, :yearly_every_xth_day, + :yearly_month_of_year2, :yearly_month_of_year, + # derived attributes + :weekly_return_monday, :weekly_return_tuesday, :weekly_return_wednesday, + :weekly_return_thursday, :weekly_return_friday, :weekly_return_saturday, :weekly_return_sunday + ) + end + end end \ No newline at end of file