Sha256: b4c09cf3e4bdcdaedb91281577c24c6b7f1bbb27be2c64b206659715affcdd70

Contents?: true

Size: 320 Bytes

Versions: 2

Compression:

Stored size: 320 Bytes

Contents

class Site
  include Mongoid::Document

  field :name

  if Mongoid::Compatibility::Version.mongoid6_or_older?
    has_many :users, inverse_of: :site, order: :email.desc, counter_cache: true
  else
    has_many :users, inverse_of: :site, order: :email.desc
  end

  validates :name, presence: true, uniqueness: true
end

Version data entries

2 entries across 2 versions & 1 rubygems

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