Created
June 23, 2017 21:07
-
-
Save ralugli/ffd4cad050f6eb8ab26592bfb35964b6 to your computer and use it in GitHub Desktop.
script.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query_builder = QueryBuilder::UserPerformanceQuery.new | |
query_builder.by_date_range(DateTime.now.beginning_of_day, DateTime.now.end_of_day) | |
list = UserPerformance.execute(query_builder.build(only_status_change: true)) | |
UserPerformance.transaction do | |
list.each do |o| | |
raise ActiveRecord::Rollback unless o.save | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment