Re: Update on Single Record

2020-08-12 Thread bee...@gmail.com
Ah I see. I've been moving methods around in my select statements so I didn't notice any progression of activity. Just tested a *.returning(:id, :bravo)* method and it didn't work post *update*, but did after *where*. Cheers On Wednesday, August 12, 2020 at 5:29:28 PM UTC-4 Jeremy Evans w

Re: Update on Single Record

2020-08-12 Thread Jeremy Evans
On Wednesday, August 12, 2020 at 1:15:56 PM UTC-7, bee...@gmail.com wrote: > > Having some trouble with updating a single field. *target* is a > generated integer, as to which record to update, and *dings* is my > current full dataset, and *newvalue *is a new string. > > dings = DBHR[:dingbats]

Update on Single Record

2020-08-12 Thread bee...@gmail.com
Having some trouble with updating a single field. *target* is a generated integer, as to which record to update, and *dings* is my current full dataset, and *newvalue *is a new string. dings = DBHR[:dingbats] newvalue = Dev.genp ids = dings.select(:id).map(:id) target = ids.sample dings.update(