-
If needing to filter out records from an
ActiveRecord_AssociationRelation
object- use an ActiveRecord Query Interface method e.g.
.where
,.joins
- see Understanding the difference between where and select in Rails
-
The bottom line is that we should always use .where rather than .select to improve the speed and save the memory of the application.
-
e.g.
- use an ActiveRecord Query Interface method e.g.
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
<!--this --> | |
.compoistion>(img.composition__photo.composition__photo--p1)*3 | |
<!-- will make this --> | |
<div class="compoistion"> | |
<img src="" alt="" class="composition__photo composition__photo--p1"> | |
<img src="" alt="" class="composition__photo composition__photo--p1"> |
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
npm i | |
npm WARN deprecated [email protected]: Way too old | |
npm WARN deprecated [email protected]: core-js@<2.6.5 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2. | |
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. | |
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). | |
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor. | |
npm WARN deprecated [email protected]: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s). | |
npm WARN deprecated [email protected]: This version has been deprec |
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
#!/usr/bin/env python3.7 | |
import iterm2 | |
# This script was created with the "basic" environment which does not support adding dependencies | |
# with pip. | |
async def main(connection): | |
# Your code goes here. Here's a bit of example code that adds a tab to the current window: | |
app = await iterm2.async_get_app(connection) | |
window = app.current_terminal_window |
Asked this in Ruby NZ Slack channel
Hey people! Hope the week is going well. I have a quesiton about RSpec (@jonrowe). I've been discussing with colleagues the use of let vs let! . I lean towards trying not to use let! and instead using let's if needed and then evaluating it in a before block. I feel I have ended up having this preference because of some pain with tests in the past where strange things seemed to be happening and we realised it was due to the use of a let! (I can't remember anything specific about this though) and also these tweets around that time were brought to my attention - https://twitter.com/penelope_zone/status/767850685329203200
RSpec advice: don't use let! use let and evaluate it in a before.
OlderNewer