Skip to content

Commit

Permalink
Initialized post resource
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlabouve committed Apr 12, 2016
1 parent 8459002 commit 3af0e6b
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/post.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Post < ActiveRecord::Base
end
1 change: 1 addition & 0 deletions app/models/private_post.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
class PrivatePost < Post; end
1 change: 1 addition & 0 deletions app/models/public_post.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
class PublicPost < Post; end
11 changes: 11 additions & 0 deletions db/migrate/20160412054952_create_posts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class CreatePosts < ActiveRecord::Migration
def change
create_table :posts do |t|
t.string :title
t.text :body
t.string :type

t.timestamps null: false
end
end
end
11 changes: 11 additions & 0 deletions test/fixtures/posts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
title: MyString
body: MyText
type:

two:
title: MyString
body: MyText
type:
7 changes: 7 additions & 0 deletions test/models/post_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class PostTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

0 comments on commit 3af0e6b

Please sign in to comment.