estimancy/projestimate

View on GitHub
app/models/widget.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Widget < ActiveRecord::Base
  attr_accessible :color, :icon_class, :name, :pe_attribute_id

  belongs_to :pe_attribute

  has_many :views_widgets, dependent: :nullify
  has_many :views, through: :views_widgets

  validates :name, presence: true

  def to_s
    name
  end

end