Skip to content

Instantly share code, notes, and snippets.

@robins35
Created January 4, 2019 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robins35/8e20263ad98243a0d9edbfc2fe8f8370 to your computer and use it in GitHub Desktop.
Save robins35/8e20263ad98243a0d9edbfc2fe8f8370 to your computer and use it in GitHub Desktop.
>> gu = GlobalUser.find 4205;
?> gu.receive_direct_message_alerts # See it's set to false
=> false
>> gu.staff.first.is_admin? # They are not an admin
=> false
>> gu.receive_direct_message_alerts = true # Therefore this should return false, but it prints true
=> true
def receive_direct_message_alerts=(flag)
staff.first.is_admin? && super(flag)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment