The code powering m.abunchtell.com https://m.abunchtell.com
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

18 Zeilen
580 B

  1. class PreserveOldLayoutForExistingUsers < ActiveRecord::Migration[5.2]
  2. disable_ddl_transaction!
  3. def up
  4. # Assume that currently active users are already using the layout that they
  5. # want to use, therefore ensure that it is saved explicitly and not based
  6. # on the to-be-changed default
  7. User.where(User.arel_table[:current_sign_in_at].gteq(1.month.ago)).find_each do |user|
  8. next if Setting.unscoped.where(thing_type: 'User', thing_id: user.id, var: 'advanced_layout').exists?
  9. user.settings.advanced_layout = true
  10. end
  11. end
  12. def down
  13. end
  14. end