Sha256: b33c5d5ae861a2d788f1f9956a6563d91970725bb896a87e32ca890c55bf82be

Contents?: true

Size: 658 Bytes

Versions: 13

Compression:

Stored size: 658 Bytes

Contents

class Post < ActiveRecord::Base

  ##
  # Constants
  #

  STATUS = { "Draft" => "draft",
             "Published" => "published",
             "Unpublished" => "unpublished",
             "<div class=''>Something special</div>".html_safe => "special" }

  ARRAY_SELECTOR = %w(item1 item2)
  ARRAY_HASH_SELECTOR = [["Draft", "draft"], ["Custom Status", "custom"]]

  ##
  # Validations
  #

  validates :body, :presence => true
  validates :title, :presence => true

  ##
  # Associations
  #

  belongs_to :favorite_comment, :class_name => "Comment"
  belongs_to :typus_user
  has_and_belongs_to_many :categories
  has_many :comments
  has_many :views

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
typus-3.0.11.rc5 test/fixtures/rails_app/app/models/post.rb
typus-3.0.11.rc4 test/fixtures/rails_app/app/models/post.rb
typus-3.0.11.rc3 test/fixtures/rails_app/app/models/post.rb
typus-3.1.0.rc4 test/fixtures/rails_app/app/models/post.rb
typus-3.1.0.rc3 test/fixtures/rails_app/app/models/post.rb
typus-3.1.0.rc2 test/fixtures/rails_app/app/models/post.rb
typus-3.0.11.rc2 test/fixtures/rails_app/app/models/post.rb
typus-3.0.11.rc1 test/fixtures/rails_app/app/models/post.rb
typus-3.1.0.rc1 test/fixtures/rails_app/app/models/post.rb
typus-3.0.10 test/fixtures/rails_app/app/models/post.rb
typus-3.0.9 test/fixtures/rails_app/app/models/post.rb
typus-3.0.8 test/fixtures/rails_app/app/models/post.rb
typus-3.0.7 test/fixtures/rails_app/app/models/post.rb