app/models/gallery.rb
# Change the name if it's already use in database
Change the name if it's already use in database
Change the name if it ' s already use in database
def define_name(name)
    i = 1
    while not self.valid?
      self.name = name + "-#{i}"
      i += 1
    end
  end
def define_name ( name ) i = 1 while not self . valid? self . name = name + "-#{i}" i += 1 end end
Change the name if it's already use in database
Change the name if it ' s already use in database
name
<not_specific>