lint this, check todo
This commit is contained in:
@@ -48,7 +48,7 @@ class Admin::RequestsController < Admin::BaseController
|
||||
@entry = Entry.find(params[:id])
|
||||
@user = @entry.requested_by
|
||||
|
||||
entry_preview = [@entry.fi, @entry.en, @entry.sv, @entry.no, @entry.ru, @entry.de].compact.first || "Entry"
|
||||
entry_preview = [ @entry.fi, @entry.en, @entry.sv, @entry.no, @entry.ru, @entry.de ].compact.first || "Entry"
|
||||
|
||||
@entry.destroy!
|
||||
@user.destroy! if @user.requested_entries.count.zero?
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ class Entry < ApplicationRecord
|
||||
end
|
||||
|
||||
def at_least_one_translation
|
||||
if [fi, en, sv, no, ru, de].all?(&:blank?)
|
||||
if [ fi, en, sv, no, ru, de ].all?(&:blank?)
|
||||
errors.add(:base, "At least one language translation is required")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user