"Fossies" - the Fresh Open Source Software Archive

Member "db/migrate/20170203000001_remove_last_login_from_history_722.rb" (25 Mar 2021, 468 Bytes) of package /linux/www/zammad-4.0.0.tar.bz2:

As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "20170203000001_remove_last_login_from_history_722.rb": 3.4.1_vs_3.5.0.

    1 class RemoveLastLoginFromHistory722 < ActiveRecord::Migration[4.2]
    2   def up
    4     # return if it's a new setup
    5     return if !Setting.exists?(name: 'system_init_done')
    7     history_object = History.object_lookup('User')
    8     return if !history_object
   10     history_attribute = History.attribute_lookup('last_login')
   11     return if !history_attribute
   13     History.where(history_object_id: history_object.id, history_attribute_id: history_attribute.id).delete_all
   14   end
   15 end