Sha256: 095b919093fe1dd8386baacf5f336b85e551095167a84b0493e68d51de492028

Contents?: true

Size: 249 Bytes

Versions: 4

Compression:

Stored size: 249 Bytes

Contents

class Post < ActiveRecord::Base
  has_and_belongs_to_many :category
  validates_presence_of :title

  def to_param
  "#{id}-#{title}".parameterize
  end

  scope :published, lambda {
  where("published = ? AND date < ?", true, Time.current)
  }
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blogmodule-1.0.2 app/models/post.rb~
blogmodule-1.0.1 app/models/post.rb~
blogmodule-1.0.0 app/models/post.rb~
blogmodule-0.0.1 app/models/post.rb~