Class: Suggester::Handlers::ActiveRecord
- Defined in:
- lib/suggester/handlers/active_record.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ ActiveRecord
constructor
A new instance of ActiveRecord.
Methods inherited from Base
Methods included from Helpers::Refresh
#force_refresh!, #last_refreshed_at, #needs_refresh?, #refresh!, #refresh_interval, #refresh_interval=
Constructor Details
#initialize(params = {}) ⇒ ActiveRecord
Returns a new instance of ActiveRecord.
7 8 9 10 11 12 13 14 15 |
# File 'lib/suggester/handlers/active_record.rb', line 7 def initialize(params = {}) @klass = params[:class] || raise("must specify a class") @klass = @klass.constantize if @klass.is_a?(String) @id_field = params[:id_field] || :id @name_field = params[:name_field] || :name @conditions = params[:conditions] || {} @include = params[:include] || {} super(params) end |