Skip to content

Commit

Permalink
associate user and status
Browse files Browse the repository at this point in the history
  • Loading branch information
madhums committed Aug 30, 2011
1 parent f97efe6 commit f0753fb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/statuses_controller.rb
Expand Up @@ -7,6 +7,7 @@ def new

def create
@status = Status.new(params[:status])
@status.user_id = current_user.id
if @status.save
flash[:notice] = "Successfully created status."
redirect_to root_url
Expand Down
1 change: 1 addition & 0 deletions app/models/status.rb
@@ -1,2 +1,3 @@
class Status < ActiveRecord::Base
belongs_to :user
end
1 change: 1 addition & 0 deletions app/models/user.rb
@@ -1,6 +1,7 @@
class User < ActiveRecord::Base
attr_accessor :password_confirmation
has_many :authorizations, :dependent => :destroy
has_many :statuses, :dependent => :destroy

acts_as_authentic do |c|
c.ignore_blank_passwords = true #ignoring passwords
Expand Down

0 comments on commit f0753fb

Please sign in to comment.