# Mise à jour "About Category" depuis la console

**URL:** https://meta.discourse.org/t/update-about-category-from-the-console/89999
**Category:** Development
**Created:** [Juin 15, 2018, 9:42 UTC](https://meta.discourse.org/t/update-about-category-from-the-console/89999 "2018-06-15T21:42:37Z")
**Posts on this page:** 3
**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: [Juin 15, 2018, 9:42 UTC](https://meta.discourse.org/t/update-about-category-from-the-console/89999/1 "2018-06-15T21:42:37Z")

</div>

I’ve got a site with 750+ categories and need to change the text in the “About this category” post to "Blah. Category Name. Blah’.

I’ve tried doing something like this:

```ruby
desc='Blah. %s Blah.'

c = Category.where("name like '%whatever%'").first
p = Post.where(topic_id: c.topic_id).first
t = Topic.find(c.topic_id)
p.raw = desc % c.name
p.cooked=p.cook(p.raw)
p.save

```

but it doesn’t change the text in the post, much less the excerpt for the topic or the category description.

What am I missing?

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [Juin 15, 2018, 10:04 UTC](https://meta.discourse.org/t/update-about-category-from-the-console/89999/2 "2018-06-15T22:04:27Z")

</div>

Did you try editing the post? I’d replace the last 3 lines of your code snippet with

```ruby
p.revise(Discourse.system_user, { raw: desc % c.name }, bypass_bump: true)

```

---

<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: [Juin 16, 2018, 1:19 UTC](https://meta.discourse.org/t/update-about-category-from-the-console/89999/3 "2018-06-16T01:19:05Z")

</div>

That looks like what I was looking for! I tried to figure out `Post.revise`, but couldn’t quite get the parameters. Thanks, @gerhard!

And Rails will magically fix up the Topic excerpt and the Category description? (I suppose I’ll know soon enough when I test it tomorrow).
