test for before_save callback and trying a where condition in model