vdanyliv/lv113.ui — pull request #16 by anato-lee (2014-08-18 13:06:33+00:00)
Title: Lvuiui 79

@xcomanche, @kuzbida , @mariyamoroz , @MyrosiaPabyrivska, @vdanyliv , @lhalam
Guys, please review if any updates needed.
I moved all active record classes into a separate file (models.rb), so now you can use multiple DB updates within a single request. For example:
------------------------------------
put '/users/:id' , :provides => :json do
pass unless request.accept? 'application/json'
@user = User.find(params[:id]) # find record from users DB table by ID
@teacher = Student.where(userId: (params[:id]) #find record from students DB table > userID collumn
@user.make_changes # make changes to users table
@teacher.make_changes # make changes to students table
end
-------------------------------------------------------