Guest User

Untitled

a guest
Apr 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. org_a = Organisation.first(:id => 1)
  2. org_b = Organisation.first(:id => 1)
  3. org_c = org_b
  4. puts org_a.to_s
  5. puts org_b.to_s
  6. puts org_c.to_s
  7.  
  8. puts "ID's a=#{org_a.object_id}, b=#{org_b.object_id}, c=#{org_c.object_id}"
  9. puts "org_a == org_b is #{org_a == org_b}"
  10.  
  11.  
  12. # Output from above
  13.  
  14. #<MAPI::Model::Organisation:0xb7bae19c>
  15. #<MAPI::Model::Organisation:0xb7b965d8>
  16. #<MAPI::Model::Organisation:0xb7b965d8>
  17. ID's a=-606244658, b=-606293268, c=-606293268
  18. org_a == org_b is false
Add Comment
Please, Sign In to add comment