Advertisement
Guest User

Untitled

a guest
Oct 7th, 2017
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. ruby-1.9.2-p0 :001 > c = Campaign::PromotionMovie.new
  2. => #<Campaign::PromotionMovie _id: 4e2fdcd9ffd78502fa000001, _type: nil, created_at: nil, updated_at: nil>
  3.  
  4. ruby-1.9.2-p0 :002 > c.contest_requests
  5. => []
  6.  
  7. ruby-1.9.2-p0 :003 > cr = Campaign::Request::PromotionMovie.new
  8. => #<Campaign::Request::PromotionMovie _id: 4e2fdce7ffd78502fa000002, _type: nil, created_at: nil, updated_at: nil, user_id: nil>
  9.  
  10. ruby-1.9.2-p0 :004 > u = User.last
  11. => #<User _id: 4dfb2166ffd78500e1000094, _type: nil, created_at: 2011-06-17 09:41:58 UTC, updated_at: 2011-06-17 12:03:31 UTC, deleted_at: nil, votes_stats: {}, name: "roman", about: nil, place: nil, language: "pl", comment_counter: nil, registered_through: :standard, slug: "roman", avatar_filename: nil, panel_last_company_id: nil, api_server_id: nil, campaign_ids: [], email: "roman313@gmail.com", encrypted_password: "$2a$10$j6IGVXSe7RbwZ/SVCEaeNuO/ge57.FJ7Gl6DZmdBXdpIaV1rCEe.a", authentication_token: nil, remember_token: nil, remember_created_at: nil, reset_password_token: nil, confirmation_token: "9eqE5xUlMFXGm7WnAPXx", confirmed_at: nil, confirmation_sent_at: 2011-06-17 09:41:58 UTC, sign_in_count: 5, current_sign_in_at: 2011-06-17 12:03:31 UTC, last_sign_in_at: 2011-06-17 11:32:44 UTC, current_sign_in_ip: "127.0.0.1", last_sign_in_ip: "127.0.0.1">
  12.  
  13. ruby-1.9.2-p0 :005 > cr.user = u
  14. => #<User _id: 4dfb2166ffd78500e1000094, _type: nil, created_at: 2011-06-17 09:41:58 UTC, updated_at: 2011-06-17 12:03:31 UTC, deleted_at: nil, votes_stats: {}, name: "roman", about: nil, place: nil, language: "pl", comment_counter: nil, registered_through: :standard, slug: "roman", avatar_filename: nil, panel_last_company_id: nil, api_server_id: nil, campaign_ids: [], email: "roman313@gmail.com", encrypted_password: "$2a$10$j6IGVXSe7RbwZ/SVCEaeNuO/ge57.FJ7Gl6DZmdBXdpIaV1rCEe.a", authentication_token: nil, remember_token: nil, remember_created_at: nil, reset_password_token: nil, confirmation_token: "9eqE5xUlMFXGm7WnAPXx", confirmed_at: nil, confirmation_sent_at: 2011-06-17 09:41:58 UTC, sign_in_count: 5, current_sign_in_at: 2011-06-17 12:03:31 UTC, last_sign_in_at: 2011-06-17 11:32:44 UTC, current_sign_in_ip: "127.0.0.1", last_sign_in_ip: "127.0.0.1">
  15. ruby-1.9.2-p0 :006 > c.contest_requests << cr
  16. => [#<Campaign::Request::PromotionMovie _id: 4e2fdce7ffd78502fa000002, _type: nil, created_at: nil, updated_at: nil, user_id: BSON::ObjectId('4dfb2166ffd78500e1000094')>]
  17.  
  18. ruby-1.9.2-p0 :007 > c.save
  19. => true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement