test/dummy/app/controllers/data_controller.rb in paginated_table-0.0.6 vs test/dummy/app/controllers/data_controller.rb in paginated_table-0.0.7
- old
+ new
@@ -11,10 +11,20 @@
paginated_table('data', data(range), :defaults => { :sort_column => 'id' })
end
private
- Datum = Struct.new(:id, :name)
+ class Datum < Struct.new(:id, :name)
+ extend ActiveModel::Naming
+
+ def to_key
+ [object_id]
+ end
+
+ def self.name
+ "Data"
+ end
+ end
module OrderableData
def order(arg)
column, direction = arg.split
sorted_data = case column