dashboard.rb 284 B

123456789101112
  1. module Blazer
  2. class Dashboard < ActiveRecord::Base
  3. has_many :dashboard_queries, dependent: :destroy
  4. has_many :queries, through: :dashboard_queries
  5. validates :name, presence: true
  6. def to_param
  7. [id, name.gsub("'", "").parameterize].join("-")
  8. end
  9. end
  10. end