Commit d460f91063aea3a33d3fd7f5810f52e7a19e715b
Committed by
Rodrigo Souto
1 parent
7e13e968
Exists in
api_tasks
and in
4 other branches
Refactor SuggestArticle to accept other article types
Showing
2 changed files
with
1 additions
and
1 deletions
Show diff stats
app/models/suggest_article.rb
@@ -41,6 +41,7 @@ class SuggestArticle < Task | @@ -41,6 +41,7 @@ class SuggestArticle < Task | ||
41 | return type if type < Article | 41 | return type if type < Article |
42 | end | 42 | end |
43 | TinyMceArticle | 43 | TinyMceArticle |
44 | + (article[:type] || 'TinyMceArticle').constantize | ||
44 | end | 45 | end |
45 | 46 | ||
46 | def perform | 47 | def perform |
app/views/tasks/_suggest_article_accept_details.html.erb
@@ -14,6 +14,5 @@ | @@ -14,6 +14,5 @@ | ||
14 | <%= labelled_form_field(_('Highlight this article'), a.check_box(:highlighted)) %> | 14 | <%= labelled_form_field(_('Highlight this article'), a.check_box(:highlighted)) %> |
15 | 15 | ||
16 | <%= a.hidden_field(:type) %> | 16 | <%= a.hidden_field(:type) %> |
17 | - | ||
18 | <%= render :partial => 'shared/lead_and_body', :locals => {:tiny_mce => true, :f => a, :lead_id => task.id} %> | 17 | <%= render :partial => 'shared/lead_and_body', :locals => {:tiny_mce => true, :f => a, :lead_id => task.id} %> |
19 | <% end %> | 18 | <% end %> |