Class: EasyModel::SearchForm

Inherits:
Object
  • Object
show all
Includes:
Column
Defined in:
lib/easy_model/search_form.rb

Overview

検索フォームの基本クラス.

詳細

ActiveRecord::Relation と同じインタフェースのメソッドをインスタンスメソッドとして持つ. 派生クラスは ActiveRecord::Relation を返す scoped メソッドを定義しなければならない. scoped メソッドの戻り値には all や exists? などの処理が delegate される.

Instance Method Summary collapse

Methods included from Column

included

Instance Method Details

#scopedObject

ActiveRecord::Relation を返す.

詳細

このメソッドは派生クラスによって上書きされることを前提としている.

戻り値

ActiveRecord::Relation.

Raises:

  • (NotImplementedError)


37
38
39
# File 'lib/easy_model/search_form.rb', line 37

def scoped
  raise NotImplementedError, 'Must define `scoped` method.'
end