Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Movie < ActiveRecord::Base
- RATINGS = %w[G PG PG-13 R NC-17]
- validates_inclusion_of :rating, :in => RATINGS,
- :if => :after_ratings_adopted?
- def after_ratings_adopted?(movie)
- self.release_date >= Date.parse('1-Nov-1968')
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement