Created
January 2, 2018 21:41
-
-
Save weixiyen/63428b18085141dc15527f49946dccf5 to your computer and use it in GitHub Desktop.
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
User | |
|> prepared(user_id: user_id, username: username) | |
|> insert(user_id: :user_id, username: :username) | |
|> if_not_exists | |
|> User.save | |
User | |
|> update(username: username) | |
|> where(user_id: user_id) | |
|> constrain(username: previous_username) | |
|> User.save | |
User | |
|> prepared(user_id: user_id) | |
|> delete(:all) # here :all refers to all fields | |
|> where(user_id: :user_id) | |
|> User.del |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment