Sha256: 84abf6e968a112fe4118b7340be82b996154347b472c6920857bfe61dd14b86a

Contents?: true

Size: 227 Bytes

Versions: 8

Compression:

Stored size: 227 Bytes

Contents

class Post < ActiveRecord::Base
  belongs_to :comment
  belongs_to :user
  
  validates_presence_of :body
  validates_presence_of :name, :if => :user?

  def user?
    !user
  end
  
  default_scope order("created_at desc")
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
squeezer-0.2.1 app/models/post.rb
squeezer-0.2.0 app/models/post.rb
squeezer-0.1.11 app/models/post.rb
squeezer-0.1.7 app/models/post.rb
squeezer-0.1.6 app/models/post.rb
squeezer-0.1.5 app/models/post.rb
squeezer-0.1.4 app/models/post.rb
squeezer-0.1.3 lib/app/models/post.rb