Module: Cheveret::Adapter::Sunspot

Defined in:
lib/cheveret/adapter/sunspot.rb

Instance Method Summary collapse

Instance Method Details

#proxyObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/cheveret/adapter/sunspot.rb', line 38

[ :current_page,
  :next_page,
  :offset,
  :per_page,
  :total,
  :total_entries,
  :total_pages
].each do |proxy|
  # this is really territory of will_paginate
  class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
    def #{proxy}(*args)
      return 0 unless collection.respond_to?(:#{proxy})
      collection.#{proxy}(*args)
    end
  RUBY_EVAL
end

#table_data_for(column, item) ⇒ Object



31
32
33
# File 'lib/cheveret/adapter/sunspot.rb', line 31

def table_data_for(column, item)
  item.stored(column.name)
end