Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Movie < ActiveRecord::Base
- end
- # 3 ways to create ActiveRecord objects
- # (the constructor checks to see what arguments it got)
- movie = Movie.new
- movie.title = 'The Help'
- movie.rating = 'PG-13'
- movie = Movie.new do |m|
- m.title = 'The Help'
- m.rating = 'PG-13'
- end
- movie = Movie.new(:title => 'The Help', :rating => 'PG-13')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement