app/models/gallery.rb
# Say if the permalink is already use or not. If the permalink is already use
# see if the permalink is not use by our own object
Say if the permalink is already use or not. If the permalink is already use
see if the permalink is not use by our own object
Say if the permalink is already use or not . If the permalink is already use see if the permalink is not use by our own object
def permalink_already_use
    if self.id.nil?
      !Gallery.find_by_permalink(self.permalink).nil?
    else
      !Gallery.find_by_permalink(self.permalink, :conditions => ['id <> ?', self.id]).nil?
    end
  end
def permalink_already_use if self . id . nil? ! Gallery . find_by_permalink ( self . permalink ) . nil? else ! Gallery . find_by_permalink ( self . permalink , :conditions => [ 'id <> ?' , self . id ] ) . nil? end end
Say if the permalink is already use or not.
Say if the permalink is already use or not .