Created
November 18, 2012 02:58
-
-
Save otkrsk/4103164 to your computer and use it in GitHub Desktop.
Rails Console
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
| # Find an object in the console | |
| User.where("query = ?", condition) | |
| # Find an attribute in the model (if it is an array) | |
| u.first.attribute | |
| # Destroy an object that has association. Better than delete. | |
| object.destroy | |
| # Pretty output | |
| YAML::ENGINE.yamler = 'syck' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment