Sha256: 4164833436d89b02f3281ce2bfa25a7f8b4e6ba64d738a078346d9b8ff32ed4c

Contents?: true

Size: 260 Bytes

Versions: 10

Compression:

Stored size: 260 Bytes

Contents

class Post < ActiveRecord::Base
  attr_accessible :title, :author, :category if Rails::VERSION::MAJOR == 3

  scope :even, -> { where('id % 2 = 0') }
  scope :odd, -> { where('id % 2 = 1') }
  scope :greater_than, lambda { |gt_id| where('id > ?', gt_id) }
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
listings-0.1.12 spec/dummy/app/models/post.rb
listings-0.1.11 spec/dummy/app/models/post.rb
listings-0.1.10 spec/dummy/app/models/post.rb
listings-0.1.8 spec/dummy/app/models/post.rb
listings-0.1.7 spec/dummy/app/models/post.rb
listings-0.1.6 spec/dummy/app/models/post.rb
listings-0.1.5 spec/dummy/app/models/post.rb
listings-0.1.4 spec/dummy/app/models/post.rb
listings-0.1.0 spec/dummy/app/models/post.rb
listings-0.0.3 spec/dummy/app/models/post.rb