Module: Posterboy::ClassMethods

Defined in:
lib/posterboy.rb

Instance Method Summary collapse

Instance Method Details

#search_on(*args) ⇒ Object

Macro to define which attributes should be searched on.

Examples:

class User < ActiveRecord::Base
  has_many :tags, through: :user_tags

  search_on :first_name, :last_name, tags: :name
end

Parameters:

  • args (Array<Symbol>)

    The attributes to search on.



97
98
99
# File 'lib/posterboy.rb', line 97

def search_on(*args)
  self.searchables = args
end