days 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,12 @@
1
1
  class CreateEntries < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :entries do |t|
4
- t.string :title
5
- t.text :body
6
- t.text :rendered
4
+ t.string :title, null: false
5
+ t.text :body, null: false
6
+ t.text :rendered, null: false
7
+ t.string :slug, null: false, unique: true
8
+ t.integer :user_id
7
9
  t.datetime :published_at
8
- t.integer :user_id
9
- t.string :slug
10
10
 
11
11
  t.timestamps
12
12
  end
@@ -1,7 +1,7 @@
1
1
  class CreateUsers < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :users do |t|
4
- t.string :login_name
4
+ t.string :login_name, null: false, unique: true
5
5
  t.binary :password_digest
6
6
 
7
7
  t.string :name
@@ -1,7 +1,7 @@
1
1
  class CreateCategories < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :categories do |t|
4
- t.string :name
4
+ t.string :name, null: false, unique: true
5
5
  end
6
6
 
7
7
  create_table :categories_entries do |t|
data/lib/days/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Days
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -31,10 +31,10 @@ Post.order('id ASC').all.each do |post|
31
31
  hash[:title] = post.title
32
32
  hash[:body] = post.body
33
33
  if post.draft == 1
34
- hash[:published_at] = post.created_at
35
- else
36
34
  hash[:published_at] = nil
37
35
  hash[:draft] = true
36
+ else
37
+ hash[:published_at] = post.created_at
38
38
  end
39
39
  if post.category
40
40
  hash[:category] = [post.category.title]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: days
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: