refactor each_batch on relation
refactor user_relation and create a spec for it
refactor each method on groups relation
refactor each & each_batch on sensor_data_relation