Project

General

Profile

Patch #1021 ยป unique_query_names.diff

Rocco Stanzione, 2008-04-08 20:58

View differences:

app/models/query.rb (working copy)
18 18
class QueryColumn  
19 19
  attr_accessor :name, :sortable, :default_order
20 20
  include GLoc
21
  
21

  
22 22
  def initialize(name, options={})
23 23
    self.name = name
24 24
    self.sortable = options[:sortable]
......
58 58
  
59 59
  validates_presence_of :name, :on => :save
60 60
  validates_length_of :name, :maximum => 255
61
	validates_uniqueness_of :name, :scope => :user_id
61 62
    
62 63
  @@operators = { "="   => :label_equals, 
63 64
                  "!"   => :label_not_equals,
    (1-1/1)