Sha256: 32a606c5c6240081670dedc5a59fc79344cc7e6da7d8a657b81bf6b241d3c433

Contents?: true

Size: 352 Bytes

Versions: 4

Compression:

Stored size: 352 Bytes

Contents

class BlogPost < ActiveRecord::Base
  validates_presence_of :title
  validates_presence_of :user_id
  
  has_many   :blog_post_tags
  belongs_to :merged_into,
             :class_name => 'BlogPost', :foreign_key => 'merged_into_id'
  has_many   :tags, :through => :blog_post_tags
  belongs_to :user
  
  def published?
    !published_at.nil?
  end
end

Version data entries

4 entries across 3 versions & 1 rubygems

Version Path
admin_assistant-2.1.0 rails_3_0/app/models/blog_post.rb
admin_assistant-2.0.1 rails_2_test/app/models/blog_post.rb
admin_assistant-2.0.1 rails_3_test/app/models/blog_post.rb
admin_assistant-1.0.1 test_rails_app/app/models/blog_post.rb