Merge pull request #606 from AyuntamientoMadrid/proposal-code
uses the month (%m) instead of the minute (%M) in the proposal code
This commit is contained in:
@@ -65,7 +65,7 @@ class Proposal < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def code
|
||||
"#{Setting.value_for("proposal_code_prefix")}-#{created_at.strftime('%Y-%M')}-#{id}"
|
||||
"#{Setting.value_for("proposal_code_prefix")}-#{created_at.strftime('%Y-%m')}-#{id}"
|
||||
end
|
||||
|
||||
def after_commented
|
||||
|
||||
@@ -125,7 +125,7 @@ describe Proposal do
|
||||
it "should have a code" do
|
||||
Setting.find_by(key: "proposal_code_prefix").update(value: "TEST")
|
||||
proposal = create(:proposal)
|
||||
expect(proposal.code).to eq "TEST-#{proposal.created_at.strftime('%Y-%M')}-#{proposal.id}"
|
||||
expect(proposal.code).to eq "TEST-#{proposal.created_at.strftime('%Y-%m')}-#{proposal.id}"
|
||||
end
|
||||
|
||||
describe "#editable?" do
|
||||
|
||||
Reference in New Issue
Block a user