-
Notifications
You must be signed in to change notification settings - Fork 120
Description
We have published news and archived news (thanks for archive widget). Sometimes you need to read archived news too. But you can not use controller show action like:
link_to item.title, refinery.news_item_path(item)
This will not work and also will crash the application.
In the controller, there is:
def find_news_item
@item = Item.published.translated.find(params[:id])
end
Because of published scope find method will crash the app. Notice that find_by_id might not.
Proposition of change:
def find_news_item
@item = Item.translated.find(params[:id])
end
You can not use any decorator for this case because of
before_filter :find_news_item
will be always called
I had to override the whole controller to see one archived news.
Is there anather way, shorter way?
If not then I can make a pull request but this is 1 line change.