-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
my model in short:
class Event ... has_many :dates, class_name: 'EventDate' accepts_nested_attributes_for :dates, allow_destroy: true ... end
when i perform assign_attributes modifying some data like this (the time has changed for date at index 0):
params = { "dates_attributes"=>{"0"=>{"starts_at"=>"2015-04-30 20:01", "_destroy"=>"0", "id"=>"553a063469702d0741050000" }}} event.assign_attributes params
the change is persisted to the database which is unexpected
MOPED: 127.0.0.1:27017 UPDATE database=xxxx_development collection=event_dates selector={"_id"=>BSON::ObjectId('553a063469702d0741050000')} update={"$set"=>{"starts_at"=>2015-04-30 18:01:00 UTC}} flags=[]