# How to rebake Bios

**URL:** https://meta.discourse.org/t/how-to-rebake-bios/49443
**Category:** Development
**Created:** [August 30, 2016, 4:41pm UTC](https://meta.discourse.org/t/how-to-rebake-bios/49443 "2016-08-30T16:41:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 30, 2016, 4:41pm UTC](https://meta.discourse.org/t/how-to-rebake-bios/49443/1 "2016-08-30T16:41:06Z")

</div>

I’ve written an importer that pulls in a database of email addresses and Bios and sticks the bio into the About (aka `bio_raw`) field. It works fine, but the bios don’t show up because they aren’t getting baked. Inquiring minds want to know:

- Will a `posts:rebake` rebake them?
- Is there a way to rebake just the bios (and not 230K posts)?
- Is there a way to trigger the rebake in the importer script?
- If I’m patient will sidekiq notice?
- Is there a question I should have asked other than these?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [August 30, 2016, 9:47pm UTC](https://meta.discourse.org/t/how-to-rebake-bios/49443/2 "2016-08-30T21:47:39Z")

</div>

Something like:

```ruby
users = UserProfile.where.not(bio_raw: nil)
users.each do |profile|
  profile.recook_bio
  profile.save
end

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 31, 2016, 4:33pm UTC](https://meta.discourse.org/t/how-to-rebake-bios/49443/3 "2016-08-31T16:33:29Z")

</div>

Thanks, @Falco. That’s the ticket!

Is there reason not to add

```plaintext
u.profile-recook_bio
u.profile.save

```

to my import script after

```
u.user_profile_update_column('bio_raw', the_imported_bio)

```

?

`update_column` updates the column without calling `profile.save`, which makes me wonder about `profile.save`, but there are lots of things I don’t understand yet. 🙂

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [August 31, 2016, 4:37pm UTC](https://meta.discourse.org/t/how-to-rebake-bios/49443/4 "2016-08-31T16:37:56Z")

</div>

From a brief read, `save` would cook for you.

In a import script I believe there’s a lot of concurrent work filling all your CPU cycles, so I would postpone something like `bio` to the final part.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 31, 2016, 4:47pm UTC](https://meta.discourse.org/t/how-to-rebake-bios/49443/5 "2016-08-31T16:47:06Z")

</div>

Thanks for RTFMing the code for me. I still have trouble **finding** the code, but I’m getting there. 🙂

I think I see why to postpone the `save`. This script imports **only** bios, though, so I think in this case it’s probably fine to just stick it in this loop.
