Class: StudySubjectSearch

Inherits:
Search
  • Object
show all
Defined in:
app/models/study_subject_search.rb

Overview

This has gotton out of control. While it certainly still functions, I would advise that search commands be a bit more concise as most are only used in one location.

Instance Method Summary collapse

Methods inherited from Search

attr_accessors, #attr_accessors, attr_accessors=, #search_order, searchable_attributes, #searchable_attributes, searchable_attributes=, #valid_orders, valid_orders, valid_orders=

Instance Method Details

#study_subjectsObject Also known as: subjects



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'app/models/study_subject_search.rb', line 40

def study_subjects
	require_dependency 'gift_card.rb' unless GiftCard
	@subjects ||= StudySubject.send(
		(paginate?)?'paginate':'all',{
			:select  => select,
			:group   => group,
			:having  => having,
			:order   => search_order,
			:joins   => joins,
			:conditions => conditions
		}.merge(
			(paginate?)?{
				:per_page => per_page||25,
				:page     => page||1
			}:{}
		)
	)
end