update form attr name to attr id to instances

This commit is contained in:
Yan
2017-08-31 11:41:38 +06:30
parent f50ca87e59
commit 2399f1d494
2 changed files with 11 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
class MenuItemAttribute < ApplicationRecord
validates_presence_of :attribute_type, :name, :value
def self.collection
MenuItemAttribute.select("name").map { |e| [e.name, e.name] }
MenuItemAttribute.select("id, name").map { |e| [e.name, e.id] }
# MenuItemAttribute.select("name").map { |e| [e.name, e.name] }
end
end