https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292015-08-11T16:35:12ZRedmineRedmine - Defect #20513: Unloadable plugin convention breaks with Rails 4.2.3https://www.redmine.org/issues/20513?journal_id=653712015-08-11T16:35:12ZPierre Pretorius
<ul></ul><p>Note that I can reproduce this in standard Rails 4.2.3 very easily. I've logged it on github: <a class="external" href="https://github.com/rails/rails/issues/21198">https://github.com/rails/rails/issues/21198</a></p>
<p>1) Create new Rails app:<br /><pre>
rails new polls
bundle exec rails generate scaffold Question name:string
bundle exec rake db:migrate
</pre></p>
<p>2) Make a model unloadable:<br /><pre>
nano app/models/question.rb
</pre></p>
<p>3) Do something that causes Rails to reload code:<br /><pre>
rails s &
curl localhost:3000/questions -s > /dev/null
touch app/models/question.rb
curl localhost:3000/questions -s > /dev/null
</pre></p>
<p>Error displayed: <strong>Unable to autoload constant Question, expected app/models/question.rb to define it.</strong></p> Redmine - Defect #20513: Unloadable plugin convention breaks with Rails 4.2.3https://www.redmine.org/issues/20513?journal_id=663782015-10-04T09:05:10ZJens Krämerjk@jkraemer.net
<ul></ul><p>+1</p>
<p>Just stumbled across the very same problem and indeed calling unloadable on plugin models (or on core models when patching them) was the culprit.</p>
<p>In addition to that <code>unloadable</code> does not seem to serve any real purpose (at least nowadays) - Rails' auto loading just works like a charm for both core and plugin code without it.</p> Redmine - Defect #20513: Unloadable plugin convention breaks with Rails 4.2.3https://www.redmine.org/issues/20513?journal_id=745002016-11-16T18:52:53ZJavier Menéndez Rizo
<ul></ul><p>When I quit the unloadable, I'm getting this from the core of redmine:</p>
<pre>
NameError
Couldn't find CustomFieldsHelper, expected it to be defined in helpers/custom_fields_helper.rb
</pre> Redmine - Defect #20513: Unloadable plugin convention breaks with Rails 4.2.3https://www.redmine.org/issues/20513?journal_id=753292016-12-25T13:36:11ZJavier Menéndez Rizo
<ul></ul><p>Javier Menéndez wrote:</p>
<blockquote>
<p>When I quit the unloadable, I'm getting this from the core of redmine:</p>
<p>[...]</p>
</blockquote>
<p>I just removed all unloadable references from my plugins and the reload is working again.</p>
<p>This was on redmine 3.3.1 and ruby 2.3.1</p> Redmine - Defect #20513: Unloadable plugin convention breaks with Rails 4.2.3https://www.redmine.org/issues/20513?journal_id=796072017-07-01T00:26:15ZAkiko Takano
<ul></ul><p>+1<br />I saw the same situation after Redmine3.x. <br />This may be wrong, but I personally think, at least the plugin which support version is Redmine3.x or higher, does not need to state unloadable.</p> Redmine - Defect #20513: Unloadable plugin convention breaks with Rails 4.2.3https://www.redmine.org/issues/20513?journal_id=804552017-08-03T09:14:26ZGo MAEDA
<ul></ul><p>Can we remove all 'unloadable' from plugin templates?</p>
<pre><code class="diff syntaxhl"><span class="gh">Index: lib/generators/redmine_plugin_controller/templates/controller.rb.erb
===================================================================
</span><span class="gd">--- lib/generators/redmine_plugin_controller/templates/controller.rb.erb (revision 16946)
</span><span class="gi">+++ lib/generators/redmine_plugin_controller/templates/controller.rb.erb (working copy)
</span><span class="p">@@ -1,6 +1,4 @@</span>
class <%= @controller_class %>Controller < ApplicationController
<span class="gd">- unloadable
-
</span> <% actions.each do |action| -%>
def <%= action %>
<span class="gh">Index: lib/generators/redmine_plugin_model/templates/model.rb.erb
===================================================================
</span><span class="gd">--- lib/generators/redmine_plugin_model/templates/model.rb.erb (revision 16946)
</span><span class="gi">+++ lib/generators/redmine_plugin_model/templates/model.rb.erb (working copy)
</span><span class="p">@@ -1,3 +1,2 @@</span>
class <%= @model_class %> < ActiveRecord::Base
<span class="gd">- unloadable
</span> end
</code></pre> Redmine - Defect #20513: Unloadable plugin convention breaks with Rails 4.2.3https://www.redmine.org/issues/20513?journal_id=824092017-12-02T10:28:21ZAkiko Takano
<ul></ul><p>Go MAEDA wrote:</p>
<blockquote>
<p>Can we remove all 'unloadable' from plugin templates?</p>
<p>[...]</p>
</blockquote>
<p>Yes we can, I personally think so.</p> Redmine - Defect #20513: Unloadable plugin convention breaks with Rails 4.2.3https://www.redmine.org/issues/20513?journal_id=825642017-12-10T12:10:18ZGo MAEDA
<ul><li><strong>Target version</strong> set to <i>4.0.0</i></li></ul><p>Setting target version to 4.0.0.</p> Redmine - Defect #20513: Unloadable plugin convention breaks with Rails 4.2.3https://www.redmine.org/issues/20513?journal_id=829702018-01-08T17:54:45ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Target version</strong> changed from <i>4.0.0</i> to <i>3.4.4</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Change committed, thanks.</p> Redmine - Defect #20513: Unloadable plugin convention breaks with Rails 4.2.3https://www.redmine.org/issues/20513?journal_id=830222018-01-10T07:59:24ZMischa The Evil
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-5 priority-4 priority-default closed" href="/issues/27963">Patch #27963</a>: Remove 'unloadable' from bundled sample plugin</i> added</li></ul>