diff --git a/app/models/product.rb b/app/models/product.rb index 8082251ac..f123e880b 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -6,7 +6,6 @@ class Product < ApplicationRecord has_many :price_lists, through: :product_prices, dependent: :restrict_with_error validates :name, :category, presence: true - validate :name_readonly accepts_nested_attributes_for :product_prices, allow_destroy: true @@ -19,10 +18,4 @@ def t_category end private - - def name_readonly - return if new_record? - - errors.add(:name, 'is readonly') if name_changed? - end end diff --git a/app/views/price_lists/index.html.erb b/app/views/price_lists/index.html.erb index 2998d0dba..8a0da018b 100644 --- a/app/views/price_lists/index.html.erb +++ b/app/views/price_lists/index.html.erb @@ -25,11 +25,11 @@
<% end %> - + @@ -60,7 +60,7 @@
- +