The code powering m.abunchtell.com https://m.abunchtell.com
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

18 řádky
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