Created
March 9, 2017 11:12
-
-
Save goodviber/601349c93e2e238fc19c5c591c4da3dd to your computer and use it in GitHub Desktop.
Array to ActiveRecord relation
This file contains hidden or 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
def job_history | |
#catch double employee association update | |
@histories = @job.versions.delete_if { |version| version.changeset.keys[0] == "updated_at" } | |
#change array to ActiveRecord relation | |
@histories = @job.versions.where(id: @histories.map(&:id)).paginate(:page => params[:page], :per_page => 15) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment