Advertisement
saasbook

Untitled

Jan 29th, 2012
5,006
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.34 KB | None | 0 0
  1. class Movie < ActiveRecord::Base
  2. end
  3. # 3 ways to create ActiveRecord objects
  4. # (the constructor checks to see what arguments it got)
  5. movie = Movie.new
  6. movie.title = 'The Help'
  7. movie.rating = 'PG-13'
  8.  
  9. movie = Movie.new do |m|
  10.   m.title = 'The Help'
  11.   m.rating = 'PG-13'
  12. end
  13.  
  14. movie = Movie.new(:title => 'The Help', :rating => 'PG-13')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement