Skip to content

Commit

Permalink
turns out this was manually disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
DrumsnChocolate committed Jan 19, 2025
1 parent 0e6cd2a commit 7330b68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
7 changes: 0 additions & 7 deletions app/models/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -19,10 +18,4 @@ def t_category
end

private

Check warning on line 20 in app/models/product.rb

View workflow job for this annotation

GitHub Actions / Lint

[Correctable] Lint/UselessAccessModifier: Useless private access modifier.

def name_readonly
return if new_record?

errors.add(:name, 'is readonly') if name_changed?
end
end
6 changes: 3 additions & 3 deletions app/views/price_lists/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
<div class="form-check">
<input class="form-check-input" type="checkbox" id="show-archived-check" v-model="showArchived">
<label class="form-check-label" for="show-archived-check">
Laat gearchieveerde prijslijsten zien
Laat gearchieveerde prijslijsten zien
</label>
</div>
<% end %>

<table id='price-lists-table' class='price-lists-table table table-striped overflow-scroll mw-100 mx-auto d-block pe-2'>
<thead class="table-header-rotated products">
<tr>
Expand Down Expand Up @@ -60,7 +60,7 @@
</td>
<td class="products-new products-name">
<div class="d-flex">
<input class="form-control flex-grow-1" placeholder="Productnaam" type="text" v-model="product.name" :disabled="product.id"/>
<input class="form-control flex-grow-1" placeholder="Productnaam" type="text" v-model="product.name">
</div>
</td>
<td class="products-new products-category">
Expand Down

0 comments on commit 7330b68

Please sign in to comment.