The code powering m.abunchtell.com https://m.abunchtell.com
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

18 satır
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