lib/ProMotion/table/extensions/indexable.rb in ProMotion-1.0.3 vs lib/ProMotion/table/extensions/indexable.rb in ProMotion-1.0.4
- old
+ new
@@ -1,9 +1,13 @@
module ProMotion
module Table
module Indexable
- def index_from_section_titles
- @promotion_table_data.filtered ? nil : @promotion_table_data.sections.collect{ |section| section[:title][0] }
+ def table_data_index
+ return nil if @promotion_table_data.filtered || !self.class.get_indexable
+
+ index = @promotion_table_data.sections.collect{ |section| section[:title][0] }
+ index.unshift("{search}") if self.class.get_searchable
+ index
end
end
end
end