diff options
Diffstat (limited to 'app/models/entry.rb')
-rw-r--r-- | app/models/entry.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/entry.rb b/app/models/entry.rb index 22b330a..87fd46d 100644 --- a/app/models/entry.rb +++ b/app/models/entry.rb | |||
@@ -1,8 +1,10 @@ | |||
1 | class Entry < ApplicationRecord | 1 | class Entry < ApplicationRecord |
2 | has_many :records, as: :recordable | 2 | has_many :records, as: :recordable, inverse_of: :recordable |
3 | 3 | ||
4 | validates :slug, presence: true, format: /\A[-a-z0-9]+\z/ | 4 | validates :slug, presence: true, format: /\A[-a-z0-9]+\z/ |
5 | 5 | ||
6 | accepts_nested_attributes_for :records, allow_destroy: true | ||
7 | |||
6 | def path | 8 | def path |
7 | "/says/#{slug}" | 9 | "/says/#{slug}" |
8 | end | 10 | end |