about summary refs log tree commit diff
path: root/app/models/form
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2023-02-18 17:09:40 -0500
committerGitHub <noreply@github.com>2023-02-19 07:09:40 +0900
commit2177daeae92b77be6797ba8f2ab6ebe1e641e078 (patch)
tree2cf004cd1611bd53f21cdb8021e98aa499448627 /app/models/form
parent167709f6b0731c163619c58afcb0ca11bb393e54 (diff)
Autofix Rubocop Style/RedundantBegin (#23703)
Diffstat (limited to 'app/models/form')
-rw-r--r--app/models/form/admin_settings.rb12
-rw-r--r--app/models/form/custom_emoji_batch.rb12
2 files changed, 10 insertions, 14 deletions
diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb
index 070478e8e..95c53084a 100644
--- a/app/models/form/admin_settings.rb
+++ b/app/models/form/admin_settings.rb
@@ -76,13 +76,11 @@ class Form::AdminSettings
     define_method(key) do
       return instance_variable_get("@#{key}") if instance_variable_defined?("@#{key}")
 
-      stored_value = begin
-        if UPLOAD_KEYS.include?(key)
-          SiteUpload.where(var: key).first_or_initialize(var: key)
-        else
-          Setting.public_send(key)
-        end
-      end
+      stored_value = if UPLOAD_KEYS.include?(key)
+                       SiteUpload.where(var: key).first_or_initialize(var: key)
+                     else
+                       Setting.public_send(key)
+                     end
 
       instance_variable_set("@#{key}", stored_value)
     end
diff --git a/app/models/form/custom_emoji_batch.rb b/app/models/form/custom_emoji_batch.rb
index f4fa84c10..484415f90 100644
--- a/app/models/form/custom_emoji_batch.rb
+++ b/app/models/form/custom_emoji_batch.rb
@@ -36,13 +36,11 @@ class Form::CustomEmojiBatch
   def update!
     custom_emojis.each { |custom_emoji| authorize(custom_emoji, :update?) }
 
-    category = begin
-      if category_id.present?
-        CustomEmojiCategory.find(category_id)
-      elsif category_name.present?
-        CustomEmojiCategory.find_or_create_by!(name: category_name)
-      end
-    end
+    category = if category_id.present?
+                 CustomEmojiCategory.find(category_id)
+               elsif category_name.present?
+                 CustomEmojiCategory.find_or_create_by!(name: category_name)
+               end
 
     custom_emojis.each do |custom_emoji|
       custom_emoji.update(category_id: category&.id)