tasafo/certifico

View on GitHub
app/models/profile.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
class Profile
  include Mongoid::Document
  include Mongoid::Timestamps::Short

  field :name, type: String, localize: true
  field :has_theme, type: Boolean, default: false

  validates_presence_of :name

  has_many :subscribers, dependent: :restrict_with_error

  scope :by_name, -> { order_by(name: :asc) }
end