# == Schema Information # # Table name: legals # # id :bigint not null, primary key # title :string # content :text # position :integer # is_visible :boolean default(“true”) # created_at :datetime not null # updated_at :datetime not null # class Legal < ApplicationRecord

include LogActions
default_scope { order(:position) }
validates_presence_of :title, :content

def self.all_visible
  where(is_visible: true)
end

def to_param
  "#{self.title.parameterize}"
end

end