working form

This commit is contained in:
Senad Uka
2016-09-08 09:59:42 +02:00
parent ec1926dec6
commit 50df27b0c0
60 changed files with 76113 additions and 46 deletions

11
app/models/author.rb Normal file
View File

@@ -0,0 +1,11 @@
class Author < ApplicationRecord
has_many :proverbs
validates :name, presence: true
validates :unique_id, presence: true, uniqueness: true
def identify_uniquely
self.unique_id = name.to_s.downcase.gsub(/[\W\s]/,'')
end
end