Sha256: 7859eb9f11645d099e37c1ef41445e458eeb2eb697b166d857de7c677fd35a23

Contents?: true

Size: 279 Bytes

Versions: 3

Compression:

Stored size: 279 Bytes

Contents

class MovieArticle < Article
  field :rating, type: Float
  field :classification, type: Integer

  validates :rating, numericality: { greater_than: 0, less_than_or_equal_to: 5 }
  validates :classification, numericality: { even: true, only_integer: true, allow_nil: false }
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongoid-rspec-4.1.0 spec/models/movie_article.rb
mongoid-rspec-4.0.1 spec/models/movie_article.rb
mongoid-rspec-4.0.0 spec/models/movie_article.rb