diff options
author | ThibG <thib@sitedethib.com> | 2019-12-19 16:07:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-19 16:07:21 +0100 |
commit | f064cd4fb8057af04f0f1db6a98fc45935811e25 (patch) | |
tree | 33375e965ba16e3491f3bc3cd733ff2331a48220 /app/models | |
parent | 66ab1f83b0d342341181e0c88da83c966391fc0c (diff) | |
parent | dace054c0680b3ac6e0da31f3ffa501cd8840fbf (diff) |
Merge pull request #1255 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/backup.rb | 2 | ||||
-rw-r--r-- | app/models/form/admin_settings.rb | 2 | ||||
-rw-r--r-- | app/models/form/custom_emoji_batch.rb | 2 | ||||
-rw-r--r-- | app/models/tag.rb | 2 |
4 files changed, 5 insertions, 3 deletions
diff --git a/app/models/backup.rb b/app/models/backup.rb index c2651313b..8eeb1748a 100644 --- a/app/models/backup.rb +++ b/app/models/backup.rb @@ -7,7 +7,7 @@ # user_id :bigint(8) # dump_file_name :string # dump_content_type :string -# dump_file_size :integer +# dump_file_size :bigint # dump_updated_at :datetime # processed :boolean default(FALSE), not null # created_at :datetime not null diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index 3398af169..84a656864 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -16,6 +16,7 @@ class Form::AdminSettings open_deletion timeline_preview show_staff_badge + enable_bootstrap_timeline_accounts bootstrap_timeline_accounts flavour skin @@ -46,6 +47,7 @@ class Form::AdminSettings open_deletion timeline_preview show_staff_badge + enable_bootstrap_timeline_accounts activity_api_enabled peers_api_enabled show_known_fediverse_at_about_page diff --git a/app/models/form/custom_emoji_batch.rb b/app/models/form/custom_emoji_batch.rb index 076e8c9e3..6b7ea5355 100644 --- a/app/models/form/custom_emoji_batch.rb +++ b/app/models/form/custom_emoji_batch.rb @@ -40,7 +40,7 @@ class Form::CustomEmojiBatch if category_id.present? CustomEmojiCategory.find(category_id) elsif category_name.present? - CustomEmojiCategory.create!(name: category_name) + CustomEmojiCategory.find_or_create_by!(name: category_name) end end diff --git a/app/models/tag.rb b/app/models/tag.rb index d3a7e1e6d..bce76fc16 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -117,7 +117,7 @@ class Tag < ApplicationRecord class << self def find_or_create_by_names(name_or_names) Array(name_or_names).map(&method(:normalize)).uniq { |str| str.mb_chars.downcase.to_s }.map do |normalized_name| - tag = matching_name(normalized_name).first || create!(name: normalized_name) + tag = matching_name(normalized_name).first || create(name: normalized_name) yield tag if block_given? |