lib/snaptable/constructor/collection.rb in snaptable-1.1.0 vs lib/snaptable/constructor/collection.rb in snaptable-1.1.1
- old
+ new
@@ -1,11 +1,11 @@
module Snaptable
module Constructor
module Collection
def collection
- model.includes(belongs_to_associations)
+ @collection.includes(belongs_to_associations)
end
def records
@records ||= filter(collection).paginate(page: params[:page], per_page: 30).order(sort_column + " " + sort_direction)
end
@@ -44,6 +44,6 @@
model.reflect_on_all_associations(:belongs_to).map{ |a| a.name }
end
end
end
-end
\ No newline at end of file
+end