GeoEntity.last
SELECT geo_entities.* FROM geo_entities ORDER BY geo_entities.id DESC LIMIT 1
returns:
County id: 4, eid: nil, pid: nil, ename: nil, etype: 2, created_at: "2011-11-21 06:26:37", updated_at: "2011-11-21 06:26:37"
# (1) copy the newrelic rpm java client into #{RAILS_ROOT}/solr/newrelic | |
# (2) add a newrelic.yml in that directory with you API key | |
# (3) add this monkey patch in an initializer to load newrelic with the solr server | |
Sunspot::Server.class_eval do | |
def run | |
command = ['java'] | |
command << "-Xms#{min_memory}" if min_memory | |
command << "-Xmx#{max_memory}" if max_memory | |
command << "-Djetty.port=#{port}" if port | |
command << "-Dsolr.data.dir=#{solr_data_dir}" if solr_data_dir |
GeoEntity.last
SELECT geo_entities.* FROM geo_entities ORDER BY geo_entities.id DESC LIMIT 1
returns:
County id: 4, eid: nil, pid: nil, ename: nil, etype: 2, created_at: "2011-11-21 06:26:37", updated_at: "2011-11-21 06:26:37"
This list is based on aliases_spec.rb.
You can see also Module: RSpec::Matchers API.
matcher | aliased to | description |
---|---|---|
a_truthy_value | be_truthy | a truthy value |
a_falsey_value | be_falsey | a falsey value |
be_falsy | be_falsey | be falsy |
a_falsy_value | be_falsey | a falsy value |
Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.
You can get all of this information on the command line.
rails generate
with no generator name will output a list of all available generators and some information about global options.
rails generate GENERATOR --help
will list the options that can be passed to the specified generator.
#/bin/bash | |
####################################### | |
# Enables or disables laptop keyboard # | |
####################################### | |
# Keyboard name to work with | |
KB_NAME="AT Translated Set 2 keyboard" | |
# Grab keyboard ID | |
KB_ID=$(xinput list | grep "$KB_NAME" | awk '{ print $7 }' | sed -r 's/id=//g') |
#!/bin/bash | |
# This script takes a clean Ubuntu Server 24.04 LTS AMI and installs and configures | |
# everything needed to deploy a Rails 7 app to it. The resulting state is a secure, | |
# production-ready instance. | |
set -euo pipefail | |
# --- AESTHETICS --- |
#!/bin/bash | |
# This script takes a clean Ubuntu Server 24.04 LTS image and installs and configures | |
# everything needed to deploy a production-ready PostgreSQL server. | |
set -euo pipefail | |
# --- AESTHETICS --- | |
GREEN='\033[0;32m' |