8 lines
259 B
Ruby
8 lines
259 B
Ruby
class Micropost < ActiveRecord::Base
|
|
belongs_to :micropostable, polymorphic: true
|
|
default_scope -> { order(created_at: :desc) }
|
|
validates :content, presence: true, length: { maximum: 140 }
|
|
# belongs_to :user
|
|
# validates :user_id, presence: true
|
|
end
|