remove duplicate code
This commit is contained in:
parent
13f2c128c6
commit
8141ad0233
1 changed files with 0 additions and 10 deletions
|
@ -106,16 +106,6 @@ class Ordergroup < Group
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Make sure, the name is uniq, add usefull message if uniq group is already deleted
|
|
||||||
def uniqueness_of_name
|
|
||||||
id = new_record? ? nil : self.id
|
|
||||||
group = Ordergroup.with_deleted.where('groups.id != ? AND groups.name = ?', id, name).first
|
|
||||||
if group.present?
|
|
||||||
message = group.deleted? ? :taken_with_deleted : :taken
|
|
||||||
errors.add :name, message
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Make sure, the name is uniq, add usefull message if uniq group is already deleted
|
# Make sure, the name is uniq, add usefull message if uniq group is already deleted
|
||||||
def uniqueness_of_name
|
def uniqueness_of_name
|
||||||
id = new_record? ? nil : self.id
|
id = new_record? ? nil : self.id
|
||||||
|
|
Loading…
Reference in a new issue