-
-
Save robins35/ddd8616f05bfaa256292ab1d559e0c46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> gu = GlobalUser.find 4205; | |
?> gu.receive_direct_message_alerts | |
=> false | |
>> gu.receive_direct_message_alerts = true # Below we see the expression returns false, yet the return value still shows true. | |
Expression result is: false | |
=> true | |
>> gu.receive_direct_message_alerts # Here we can see that the method is working as intended, the value is still set to false, however the console returns true above. | |
=> false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def receive_direct_message_alerts=(flag) | |
puts "Expression result is: #{staff.first.is_admin? && super(flag)}" | |
return false unless staff.first.is_admin? | |
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