fix post sorting issue
This commit is contained in:
parent
4f3d33c322
commit
33953445b7
GemfileGemfile.lock
app
models
views/posts
_2014-04-10-official-start.haml_2014-04-22-to-see-or-not-to_c.haml_2014-04-24-asm-out.haml_2014-05-06-first-parses.haml_2014-05-20-first-fibo.haml_2014-06-10-more-clarity.haml_2014-06-27-an-exceptional-thought.haml_2014-07-05-layers-vs-passes.haml_2014-07-17-framing.haml_2014-08-01-name-has-been-found.haml_2014-08-19-object-storage.haml_2014-09-12-register-allocation-reviewed.haml_2014-09-30-a-better-register-machine.haml_2015-03-21-review-_2015.haml_2015-05-20-expression-is-slot.haml_2015-06-20-the-static-call-chain.haml_2015-07-01-hello-world-again.haml_2015-07-25-i-like-not-playing-computer.haml_2015-09-03-a-new-language.haml_2016-03-07-mixup-of-levels.haml_2016-07-26-the-road-ahead.haml_2017-01-02-a-new-year-a-new-name.haml_2017-01-10-integer-unification.haml_2017-02-03-of-slopes-and-chains-and-changes-in-the-air.haml_2017-03-03-layer-summary.haml_2017-04-07-how-not-to-interpret.haml_2017-09-05-more-types-will-come-but-later.haml_2018-04-09-a-dynamic-hello-world.haml_2018-05-01-four-years-and-going-strong.haml
lib
spec/models
2
Gemfile
2
Gemfile
@ -1,7 +1,5 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
ruby '2.4.1'
|
||||
|
||||
gem 'rails'
|
||||
gem 'sqlite3'
|
||||
gem 'puma', '~> 3.11'
|
||||
|
@ -318,8 +318,5 @@ DEPENDENCIES
|
||||
uglifier
|
||||
web-console (>= 3.3.0)
|
||||
|
||||
RUBY VERSION
|
||||
ruby 2.4.1p111
|
||||
|
||||
BUNDLED WITH
|
||||
1.16.0
|
||||
1.16.1
|
||||
|
@ -21,10 +21,10 @@ class Post
|
||||
@words.join(" ")
|
||||
end
|
||||
def template_name
|
||||
"#{date}-#{@words.join("-")}"
|
||||
"#{year}-#{month.to_s.rjust(2, '0')}-#{day.to_s.rjust(2, '0')}-#{@words.join("-")}"
|
||||
end
|
||||
def date
|
||||
"#{year}-#{month}-#{day}"
|
||||
Date.new(year,month,day)
|
||||
end
|
||||
def parse_int( value , max)
|
||||
ret = value.to_i
|
||||
|
0
app/views/posts/_2014-7-5-layers-vs-passes.haml → app/views/posts/_2014-07-05-layers-vs-passes.haml
0
app/views/posts/_2014-7-5-layers-vs-passes.haml → app/views/posts/_2014-07-05-layers-vs-passes.haml
@ -31,10 +31,10 @@ RSpec.describe Post, type: :model do
|
||||
expect(@post.month).to eq 2
|
||||
end
|
||||
it "returns date" do
|
||||
expect(@post.date).to eq "1993-2-4"
|
||||
expect(@post.date).to eq Date.new(1993,2,4)
|
||||
end
|
||||
it "returns file_name" do
|
||||
expect(@post.template_name).to eq "1993-2-4-title"
|
||||
expect(@post.template_name).to eq "1993-02-04-title"
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user