recurring_select
recurring_select copied to clipboard
allow_blank doesn't work.
When I use the :allow_blank => true option, I end up with an 'allow_blank' option in the dropdown. If I then save the model, the rule gets serialized to the string 'true'.
same here
When I opensourced this, I didn't notice that the locations we use blank actually have a setter method on the model to handle this scenario.
class RecurringModel
attribute_accessible :recurring_rule
serialize :recurring_rule, Hash
....
def recurring_rule=(new_rule)
if RecurringSelect.is_valid_rule?(new_rule)
write_attribute(:recurring_rule, RecurringSelect.dirty_hash_to_rule(new_rule).to_hash)
else
write_attribute(:recurring_rule, nil)
end
end
end
I'll need to write a :accepts_recurring
module which can be mixed into ActiveRecord for making accepting these parameters easier.
Sorry mate, missed the notification for your reply. If I can find some time, I'll try help resolve this. Cheers.