update achievement gain date to submission date(not grading date)

1. It makes the leaderboard more fair.
2. Tested properly, it works.
Oh, yes !
On Sep 12, 2014 9:50 AM, "Raymoond Tang" <notifications@github.com> wrote:

> In lib/tasks/user_achievement.rake:
>
> > @@ -0,0 +1,18 @@
> > +namespace :user_achievement do
> > +  desc "set obtain date to submitted date or create_at"
> > +  task :set_obtain_date => :environment do
> > +    UserAchievement.all.each do |uach|
> > +      obtained_at = obtained_date(uach.achievement, uach.user_course_id)
> > +      uach.obtained_at ||=  obtained_at || uach.created_at
> > +      uach.save
> > +    end
> > +  end
> > +
> > +  def obtained_date(achievement, user_course_id)
>
> no need copy and past, don't you already have the method ?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Coursemology/coursemology.org/pull/204/files#r17460018>
> .
>