Skip to content

Commit

Permalink
associated users with microposts
Browse files Browse the repository at this point in the history
  • Loading branch information
bob committed Oct 7, 2012
1 parent e5e4124 commit 24f2188
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/models/micropost.rb
@@ -1,3 +1,9 @@
class Micropost < ActiveRecord::Base

attr_accessible :content, :user_id

belongs_to :user

validates :content, :length => { :maximum => 140 }

end
1 change: 1 addition & 0 deletions app/models/user.rb
@@ -1,3 +1,4 @@
class User < ActiveRecord::Base
attr_accessible :email, :name
has_many :microposts
end

0 comments on commit 24f2188

Please sign in to comment.