adds code to proposals

This commit is contained in:
Juanjo Bazán
2015-09-12 13:14:59 +02:00
parent 3889184432
commit e407173e4b
2 changed files with 10 additions and 0 deletions

View File

@@ -74,6 +74,10 @@ class Proposal < ActiveRecord::Base
user.level_two_verified? || !user.voted_for?(self)
end
def code
"#{Setting.value_for("proposal_code_prefix")}-#{created_at.strftime('%Y-%M')}-#{id}"
end
protected
def sanitize_description