Skip to content

Commit

Permalink
Change default to single column UI (mastodon#10847)
Browse files Browse the repository at this point in the history
Keep current setting for users who were active within the last month
  • Loading branch information
Gargron authored and multiple creatures committed Nov 19, 2019
1 parent e1ff8b2 commit 35d85c1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defaults: &defaults
flavour: 'glitch'
skin: 'default'
aggregate_reblogs: true
advanced_layout: true
advanced_layout: false
notification_emails:
follow: false
reblog: false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class PreserveOldLayoutForExistingUsers < ActiveRecord::Migration[5.2]
disable_ddl_transaction!

def up
# Assume that currently active users are already using the layout that they
# want to use, therefore ensure that it is saved explicitly and not based
# on the to-be-changed default

User.where(User.arel_table[:current_sign_in_at].gteq(1.month.ago)).find_each do |user|
next if Setting.unscoped.where(thing_type: 'User', thing_id: user.id, var: 'advanced_layout').exists?
user.settings.advanced_layout = true
end
end

def down
end
end
10 changes: 0 additions & 10 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,6 @@
t.index ["target_account_id"], name: "index_blocks_on_target_account_id"
end

create_table "bookmarks", force: :cascade do |t|
t.bigint "account_id", null: false
t.bigint "status_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id", "status_id"], name: "index_bookmarks_on_account_id_and_status_id", unique: true
t.index ["account_id"], name: "index_bookmarks_on_account_id"
t.index ["status_id"], name: "index_bookmarks_on_status_id"
end

create_table "conversation_mutes", force: :cascade do |t|
t.bigint "conversation_id", null: false
t.bigint "account_id", null: false
Expand Down

0 comments on commit 35d85c1

Please sign in to comment.