<spanclassName='hint'><FormattedMessageid='settings.notifications.favicon_badge.hint'defaultMessage="Add a badge for unread notifications to the favicon"/></span>
raiseArgumentError,'Do not call update_count! on dirty objects'ifassociation(:account_stat).loaded?&&account_stat&.changed?&&account_stat.changed_attribute_names_to_save==%w(id)
value=value.to_i
default_value=value.positive??value:0
# We do an upsert using manually written SQL, as Rails' upsert method does
# not seem to support writing expressions in the UPDATE clause, but only
# re-insert the provided values instead.
# Even ARel seem to be missing proper handling of upserts.
@ -37,7 +37,7 @@ class FixAccountsUniqueIndex < ActiveRecord::Migration[5.2]
end
end
duplicates=Account.connection.select_all('SELECT string_agg(id::text, \',\') AS ids FROM accounts GROUP BY lower(username), lower(domain) HAVING count(*) > 1').to_hash
duplicates=Account.connection.select_all('SELECT string_agg(id::text, \',\') AS ids FROM accounts GROUP BY lower(username), lower(domain) HAVING count(*) > 1').to_ary
@ -2,7 +2,7 @@ class DowncaseCustomEmojiDomains < ActiveRecord::Migration[5.2]
disable_ddl_transaction!
defup
duplicates=CustomEmoji.connection.select_all('SELECT string_agg(id::text, \',\') AS ids FROM custom_emojis GROUP BY shortcode, lower(domain) HAVING count(*) > 1').to_hash
duplicates=CustomEmoji.connection.select_all('SELECT string_agg(id::text, \',\') AS ids FROM custom_emojis GROUP BY shortcode, lower(domain) HAVING count(*) > 1').to_ary
desc'Setup the db or migrate depending on state of db'
@ -50,7 +19,7 @@ namespace :db do
task:post_migration_hookdo
at_exitdo
unless%w(C POSIX).include?(ActiveRecord::Base.connection.execute('SELECT datcollate FROM pg_database WHERE datname = current_database();').first['datcollate'])
unless%w(C POSIX).include?(ActiveRecord::Base.connection.select_one('SELECT datcollate FROM pg_database WHERE datname = current_database();')['datcollate'])