Initial commit

This commit is contained in:
2013-06-28 01:22:16 -04:00
commit cda1fef08a
74 changed files with 2011 additions and 0 deletions

0
app/models/.gitkeep Normal file
View File

10
app/models/ability.rb Normal file
View File

@@ -0,0 +1,10 @@
class Ability
include CanCan::Ability
def initialize user
user ||= User.new # guest access
can :manage, Post, user_id: user.id
can :read, Post
end
end

4
app/models/post.rb Normal file
View File

@@ -0,0 +1,4 @@
class Post < ActiveRecord::Base
belongs_to :user
attr_accessible :body, :title, :user_id
end

11
app/models/user.rb Normal file
View File

@@ -0,0 +1,11 @@
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
# attr_accessible :title, :body
end