Guest User

Untitled

a guest
Jun 19th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. >> t = Task.new :name => "test"
  2. t = Task.new :name => "test"
  3.  
  4. => #<Task id: nil, name: "test", priority: nil, duration: nil, description: nil, parent_id: nil, created_at: nil, updated_at: nil>
  5.  
  6. >> t.users
  7. t.users
  8.  
  9. => []
  10.  
  11. >> ref = TaskReference.new
  12. ref = TaskReference.new
  13.  
  14. => #<TaskReference id: nil, user_id: nil, parent_id: nil, position: nil, task_id: nil, role: nil, created_at: nil, updated_at: nil>
  15.  
  16. >> ref.user = User.first
  17. ref.user = User.first
  18.  
  19. => #<User id: 1, login: "quentin", email: "quentin@example.com", crypted_password: "00742970dc9e6319f8019fd54864d3ea740f04b1", salt: "7e3041ebc2fc05a40c60028e2c4901a81035d3cd", created_at: "2009-05-22 15:44:50", updated_at: "2009-05-27 15:44:50", remember_token: nil, remember_token_expires_at: nil>
  20.  
  21. >> t.task_references << ref
  22. t.task_references << ref
  23.  
  24. => [#<TaskReference id: nil, user_id: 1, parent_id: nil, position: nil, task_id: nil, role: nil, created_at: nil, updated_at: nil>]
  25.  
  26. >> t.users
  27. t.users
  28.  
  29. => []
  30.  
  31. >> t.task_references
  32. t.task_references
  33.  
  34. => [#<TaskReference id: nil, user_id: 1, parent_id: nil, position: nil, task_id: nil, role: nil, created_at: nil, updated_at: nil>]
Add Comment
Please, Sign In to add comment