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
# DM 0.9.9 | |
users = User.all | |
names = users.collect{|u| u.first_name} | |
names.uniq # works well, return all the names | |
names.uniq! # diff from MRI: return nil | |
# MRI | |
a = [1, 2, 3, 1, 2] | |
a.uniq #[3] | |
puts a #[1, 2, 3, 1, 2] | |
a.uniq! #[3] # diff from the DM | |
puts a # [3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment