# When should Discourse upgrade to Rails 5?

**URL:** https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123
**Category:** Development
**Created:** [30 ביולי,‏ 2017,‏ 9:26pm UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123 "2017-07-30T21:26:52Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [13 בספטמבר,‏ 2017,‏ 6:56am UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/21 "2017-09-13T06:56:56Z")

</div>

Run 500 iterations instead of 100, you should see more stable results

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [13 בספטמבר,‏ 2017,‏ 6:57am UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/22 "2017-09-13T06:57:43Z")

</div>

I’ve been running the `bench.rb` script with 500 iterations. Maybe I should bump it to 1000?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [13 בספטמבר,‏ 2017,‏ 6:58am UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/23 "2017-09-13T06:58:34Z")

</div>

Maybe amend it to do a longer warmup, results should be ultra stable we must fix our script

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [13 בספטמבר,‏ 2017,‏ 7:37am UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/24 "2017-09-13T07:37:48Z")

</div>

Just fixed a couple of bugs in our script. It turns out that our admin routes were actually throwing 500s which lead to incorrect benchmark results.

[https://github.com/discourse/discourse/commit/26c6447161853a96694ce7c8dda689d33849cc52](https://github.com/discourse/discourse/commit/26c6447161853a96694ce7c8dda689d33849cc52)

I added a guard in the script to ensure that the routes we’re hitting are returning 200 before we start benchmarking.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [25 בספטמבר,‏ 2017,‏ 7:12am UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/26 "2017-09-25T07:12:36Z")

</div>

Rails 5.1 is merged into Discourse.

One notable change which was a source of pain in development for me is that Sidekiq supports live reloading with Rails 5 but dependencies in each file has to be required properly. Otherwise, the job will be stucked in the Sidekiq queue. I’ve fixed most that I can find but if you run into any other job, feel free to let me know.

[https://github.com/discourse/discourse/commit/23b787e0a6a695ff8b70d095eb6d0ce603f28f15](https://github.com/discourse/discourse/commit/23b787e0a6a695ff8b70d095eb6d0ce603f28f15)

---

<div class="post-metadata">

### Author: ![arrowcircle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arrowcircle/32/100035_2.png) [@arrowcircle](https://meta.discourse.org/u/arrowcircle)
#### Post date: [25 בספטמבר,‏ 2017,‏ 1:55pm UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/27 "2017-09-25T13:55:23Z")

</div>

Is it good time to introduce microservices to speed up main actions?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [25 בספטמבר,‏ 2017,‏ 3:39pm UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/28 "2017-09-25T15:39:28Z")

</div>

Rails 5 broke a few of my plugins because of the change from `before_filter` to `before_action`.

I did a quick search through [GitHub - discourse/all-the-plugins · GitHub](http://github.com/discourse/all-the-plugins) for `before_filter` and found these other ones that will be broken:

```plaintext
./plugins/babble/app/controllers/posts_controller.rb:4: before_filter :ensure_logged_in, except: :index
./plugins/babble/app/controllers/topics_controller.rb:4: before_filter :set_default_id, only: :default
./plugins/babble/app/controllers/topics_controller.rb:5: before_filter :ensure_logged_in, except: [:show, :index]
./plugins/blog/app/controllers/blog/application_controller.rb:8: before_filter :cache_anon
./plugins/discourse-admin-statistics-digest/lib/admin_statistics_digest/active_user.rb:35: signed_up_before_filter = if filters.signed_up_before
./plugins/discourse-admin-statistics-digest/lib/admin_statistics_digest/active_user.rb:88: #{ signed_up_before_filter }
./plugins/discourse-atom-receiver/app/controllers/discourse_atom_receiver/atom_file_controller.rb:5: skip_before_filter :check_xhr
./plugins/discourse-blogger-plugin/plugin.rb:33: skip_before_filter :check_xhr, :preload_json, :verify_authenticity_token
./plugins/discourse-blogger-plugin/plugin.rb:35:# before_filter :ensure_embeddable, except: [:info]
./plugins/discourse-donations/app/controllers/discourse_donations/charges_controller.rb:7: skip_before_filter :verify_authenticity_token, only: [:create]
./plugins/discourse-layouts/controllers/widget.rb:4: before_filter :ensure_admin
./plugins/discourse-plugin-permalink/integrate.rb:35: klass.skip_before_filter :check_xhr, only: [:permalink]
./plugins/discourse-plugin-shared-edit/plugin.rb:59: before_filter :can_change_share_edit?
./plugins/discourse-qa/plugin.rb:39: before_filter :check_if_voted, only: :create
./plugins/discourse-reset-bump/plugin.rb:42: # You'll find other plugins and Discourse code using before_filter instead of
./plugins/discourse-reset-bump/plugin.rb:44: # makes 'before_filter' deprecated and start causing warnings, and Rails 5.1 will remove
./plugins/discourse-slackdoor/plugin.rb:24: before_filter :slackdoor_enabled?
./plugins/discourse-slackdoor/plugin.rb:25: before_filter :slackdoor_username_present?
./plugins/discourse-slackdoor/plugin.rb:26: before_filter :slackdoor_token_valid?
./plugins/discourse-user-feedback/app/controllers/ratings_controller.rb:4: before_filter :ensure_topic_existence
./plugins/dl-license-keys/app/controllers/dl_license_keys/license_users_controller.rb:6: skip_before_filter :check_xhr, only: [:validate]
./plugins/retort/plugin.rb:30: before_filter :verify_post_and_user, only: :update

```

Some of these might be obsolete - if so maybe they can be removed from the all-the-plugins repo, and moved to #plugin:broken-plugin to avoid any future confusion.

babble @gdpelican  
blog @sam  
~~**(official?)** discourse-atom-receiver~~  
discourse-blogger-plugin @kcoop  
discourse-donations @rimian  
discourse-layouts @angus  
discourse-plugin-permalink @lightyear  
discourse-qa @angus  
~~discourse-reset-bump `@LeoDavidson`~~ (just a comment)  
discourse-slackdoor @mcwumbly  
discourse-user-feedback `@jafeth.diazc`  
dl-license-keys `@joebuhlig`  
retort `@gdpelican`

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [25 בספטמבר,‏ 2017,‏ 3:40pm UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/29 "2017-09-25T15:40:03Z")

</div>

@jafeth.diazc @joebuhlig @gdpelican see above post (could only mention 10 people at a time)

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [25 בספטמבר,‏ 2017,‏ 3:47pm UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/30 "2017-09-25T15:47:38Z")

</div>

> [@david](#):
>
> discourse-slackdoor

Not obsolete yet, I don’t think. This functionality doesn’t exist yet in the new slack plugin, does it?

Will put it on my list to fix… Hopefully soon…

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [25 בספטמבר,‏ 2017,‏ 3:53pm UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/31 "2017-09-25T15:53:02Z")

</div>

> [@mcwumbly](#):
>
> This functionality doesn’t exist yet in the new slack plugin, does it?

Nope, not included in slack-official or chat-integration

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [25 בספטמבר,‏ 2017,‏ 7:12pm UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/32 "2017-09-25T19:12:01Z")

</div>

Thanks for calling this out David. I hadn’t noticed Rails 5 was official yet so hadn’t touched this at all. Now it looks I need to hustle. 😬

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [26 בספטמבר,‏ 2017,‏ 1:24am UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/33 "2017-09-26T01:24:14Z")

</div>

Hopefully this is all that’s needed:

[https://github.com/mcwumbly/discourse-slackdoor/commit/26ec8b4bf84aca08596d85c5f2fc8c8f1efa5d12](https://github.com/mcwumbly/discourse-slackdoor/commit/26ec8b4bf84aca08596d85c5f2fc8c8f1efa5d12)

(Wish I had CI set up for this thing).

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [26 בספטמבר,‏ 2017,‏ 1:56am UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/34 "2017-09-26T01:56:04Z")

</div>

Nescis quid serus vesper vehat 🌛

Thanks David.

Note that, if you have written specs, all

`xhr :method, :action, params`

has to be re-written as

`method :action, params: params, format: :json`

---

<div class="post-metadata">

### Author: ![gdpelican](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gdpelican/32/81308_2.png) [@gdpelican](https://meta.discourse.org/u/gdpelican)
#### Post date: [27 בספטמבר,‏ 2017,‏ 5:50am UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/35 "2017-09-27T05:50:04Z")

</div>

Thanks for the heads up @david, I’ve 🔧 my things. 😃

---

<div class="post-metadata">

### Author: ![ChrisBeach](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisbeach/32/214628_2.png) [@ChrisBeach](https://meta.discourse.org/u/ChrisBeach)
#### Post date: [27 בספטמבר,‏ 2017,‏ 6:56am UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/36 "2017-09-27T06:56:32Z")

</div>

Is it safe to do an update of my forum at the moment? Are people finding any instability / upgrade issues post-Rails-upgrade?

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [27 בספטמבר,‏ 2017,‏ 7:07am UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/37 "2017-09-27T07:07:54Z")

</div>

Hang fire for now. @tgxworld is investigating a possible instability.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [27 בספטמבר,‏ 2017,‏ 12:29pm UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/38 "2017-09-27T12:29:31Z")

</div>

Looks like @tgxworld has concluded his investigation. Should be safe to update, but it couldn’t hurt to wait a day or two more while we finish ironing out any additional unexpected issues.

---

<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: [27 בספטמבר,‏ 2017,‏ 1:42pm UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/39 "2017-09-27T13:42:04Z")

</div>

And if you use any non official plugins you’ll want to be especially careful.

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [27 בספטמבר,‏ 2017,‏ 2:19pm UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/40 "2017-09-27T14:19:50Z")

</div>

I’m with @pfaffman here. I just finished pushing updates to the majority of my plugins to cover this but I’m sure there are others still working on it.

---

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [27 בספטמבר,‏ 2017,‏ 4:14pm UTC](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123/41 "2017-09-27T16:14:06Z")

</div>

Thank you for your efforts! Does this mean that the username search related PR can finally be merged in? 🙂

[https://github.com/discourse/discourse/pull/4974](https://github.com/discourse/discourse/pull/4974)

[Previous page](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123.md?page=1)

[Next page](https://meta.discourse.org/t/when-should-discourse-upgrade-to-rails-5/67123.md?page=3)
