config/initializers/omniauth.rb
# check API hashes for missing login providers / omniauth strategies.
# action: 0: compare, 1: check first hash, 2. check second hash
check API hashes for missing login providers / omniauth strategies.
action: 0: compare, 1: check first hash, 2. check second hash
check API hashes for missing login providers / omniauth strategies . action : 0 : compare 1 : check first hash 2 . check second hash
def compare_keys (name1, name2, action=0)
  hash1 = eval(name1)
  hash2 = eval(name2)
  dif1 = (hash1.keys - hash2.keys).sort.join(', ')
  dif2 = (hash2.keys - hash1.keys).sort.join(', ')
  logger.warn2 "provider(s) #{dif1} missing in #{name2}" if [0,1].index(action) and !dif1.empty?
  logger.warn2 "provider(s) #{dif2} missing in #{name1}" if [0,2].index(action) and !dif2.empty?
end
def compare_keys ( name1 , name2 , action = 0 ) hash1 = eval ( name1 ) hash2 = eval ( name2 ) dif1 = ( hash1 . keys - hash2 . keys ) . sort . join ( ', ' ) dif2 = ( hash2 . keys - hash1 . keys ) . sort . join ( ', ' ) logger . warn2 "provider(s) #{dif1} missing in #{name2}" if [ 0 , 1 ] . index ( action ) and ! dif1 . empty? logger . warn2 "provider(s) #{dif2} missing in #{name1}" if [ 0 , 2 ] . index ( action ) and ! dif2 . empty? end
check API hashes for missing login providers / omniauth strategies.
check API hashes for missing login providers / omniauth strategies .
name1
<not_specific>
name2
<not_specific>
action
<not_specific>