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