Skip to content

Commit a5ed8f7

Browse files
authored
Change default to single column UI (mastodon#10847)
Keep current setting for users who were active within the last month
1 parent 719d789 commit a5ed8f7

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

config/settings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ defaults: &defaults
3131
noindex: false
3232
theme: 'default'
3333
aggregate_reblogs: true
34-
advanced_layout: true
34+
advanced_layout: false
3535
notification_emails:
3636
follow: false
3737
reblog: false
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class PreserveOldLayoutForExistingUsers < ActiveRecord::Migration[5.2]
2+
disable_ddl_transaction!
3+
4+
def up
5+
# Assume that currently active users are already using the layout that they
6+
# want to use, therefore ensure that it is saved explicitly and not based
7+
# on the to-be-changed default
8+
9+
User.where(User.arel_table[:current_sign_in_at].gteq(1.month.ago)).find_each do |user|
10+
next if Setting.unscoped.where(thing_type: 'User', thing_id: user.id, var: 'advanced_layout').exists?
11+
user.settings.advanced_layout = true
12+
end
13+
end
14+
15+
def down
16+
end
17+
end

db/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema.define(version: 2019_05_19_130537) do
13+
ActiveRecord::Schema.define(version: 2019_05_29_143559) do
1414

1515
# These are extensions that must be enabled in order to support this database
1616
enable_extension "plpgsql"

0 commit comments

Comments
 (0)