Sha256: 58d2332e335279cf9ad31f9d34a7257103fba2e34e116d73333425242a9cb0be

Contents?: true

Size: 162 Bytes

Versions: 17

Compression:

Stored size: 162 Bytes

Contents

class Post < ActiveRecord::Base
  belongs_to :user
  def self.search(q)
    return where('posts.title LIKE :q OR posts.body LIKE :q', {:q => "%#{q}%"})
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
magic_grid-0.12.6 test/dummy/app/models/post.rb
magic_grid-0.12.5 test/dummy/app/models/post.rb
magic_grid-0.12.4 test/dummy/app/models/post.rb
magic_grid-0.12.3 test/dummy/app/models/post.rb
magic_grid-0.12.2 test/dummy/app/models/post.rb
magic_grid-0.12.1 test/dummy/app/models/post.rb
magic_grid-0.12.0 test/dummy/app/models/post.rb
magic_grid-0.11.1 test/dummy/app/models/post.rb
magic_grid-0.11.0 test/dummy/app/models/post.rb
magic_grid-0.10.4 test/dummy/app/models/post.rb
magic_grid-0.10.3 test/dummy/app/models/post.rb
magic_grid-0.10.2 test/dummy/app/models/post.rb
magic_grid-0.10.1 test/dummy/app/models/post.rb
magic_grid-0.10.0 test/dummy/app/models/post.rb
magic_grid-0.9.3.1 test/dummy/app/models/post.rb
magic_grid-0.9.3 test/dummy/app/models/post.rb
magic_grid-0.9.2 test/dummy/app/models/post.rb