Hi,
I have a very simple record
policy_number = 'P000031206'
ccsb_group_record = EdiShop::ShopGroupCrosswalk.where(:policynumber =>
policy_number).first
# #<EdiShop::ShopGroupCrosswalk @values={:policynumber=>"P000031206",
:group_id=>"M10050", :orig_eff_dt=>2014-07-01 00:00:00 -0700,
:eff_dt=>2019-07-01 00:00:00 -0700, :renew_dt=>2020-07-01 00:00:00 -0700}>
ccsb_group_record.eff_dt = Date.civil(2020,7,1)
#<EdiShop::ShopGroupCrosswalk @values={:policynumber=>"P000031206",
:group_id=>"M10050", :orig_eff_dt=>2014-07-01 00:00:00 -0700,
:eff_dt=>2020-07-01 00:00:00 -0700, :renew_dt=>2020-07-01 00:00:00 -0700}>
ccsb_group_record.save
# Sequel::NoExistingObject: Attempt to update object did not result in a single
row modification (SQL: UPDATE TOP (1) [EDI_SHOP].[DBO].[GROUP_CROSSWALK] SET
[POLICYNUMBER] = N'P000031206', [GROUP_ID] = N'M10050', [ORIG_EFF_DT] =
'2014-07-01T00:00:00.000', [EFF_DT] = '2020-07-01T00:00:00.000', [RENEW_DT] =
'2020-07-01T00:00:00.000' WHERE ([POLICYNUMBER] IS NULL))
I don't understand where is WHERE ([POLICYNUMBER] IS NULL)) coming from. How
can I fix update this record besides using the class method below?
EdiShop::ShopGroupCrosswalk.where(:policynumber =>
policy_number).update(eff_dt: Date.civil(2020,7,1))
thank you.
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/c3564243-8788-40a3-b6f5-cbe52a7ebca6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.