Step 3 / Select topic Rails Easy

What this bank covers

  • Counting rows matching a where hash
  • order then first
  • pluck returns plain values
  • where.not negates a condition
  • SQL string condition with a bind placeholder
  • sum as a calculation method
  • Chaining order, limit and pluck
  • Counting with where
  • order plus pluck
  • has_many collection count
  • belongs_to reader
  • dependent: :destroy
  • has_one and create_profile!
  • has_many :through
  • belongs_to with class_name
  • Scoped has_many ordering
  • has_many scopes the collection by foreign key
  • dependent: :destroy removes associated records
  • has_one returns a single record, not a collection
  • before_save can rewrite attributes
  • throw :abort cancels the save
  • errors are keyed by attribute
  • uniqueness validation blocks duplicates
  • before_save normalizes attributes
  • valid? with a missing required attribute
  • Order of create callbacks
  • Returning false does not halt the callback chain
  • Halting destroy with throw :abort
  • Reading a column type from the schema
  • Implicit primary key in create_table
  • Column defaults reach new objects
  • null: false in the schema
  • add_column on an existing table
  • rename_column changes the schema in place
  • references creates a foreign key column
  • remove_column drops a column
  • The limit option on a string column
  • RESTful verbs for resources
  • Path helpers from resources
  • Default route count for resources
  • The edit route pattern
  • Recognising a PATCH request
  • Nested resource paths
  • Limiting routes with :only
  • The new route
  • Singular and plural helpers
  • Extra member routes
  • String#pluralize with an irregular noun
  • Object#blank? on whitespace
  • String#camelize
  • Hash#except
  • Numeric#megabytes
  • Integer#ordinalize
  • String#parameterize
  • Object#try on nil
  • Numeric#week as seconds
  • ActiveSupport in_groups_of
  • SecureRandom.hex returns twice as many characters as bytes
  • ParameterFilter replaces sensitive values with [FILTERED]
  • Quoting escapes embedded single quotes by doubling them
  • HTML escaping neutralises angle brackets
  • secure_compare still reports unequal strings as false
  • SHA-256 hex digests are 64 characters
  • MessageEncryptor round-trips a payload
  • Tampered signed messages raise InvalidSignature
  • sanitize_sql_like escapes LIKE wildcards
  • fixed_length_secure_compare demands equal lengths
  • pluck returns plain column values
  • pluck and map return the same values
  • find_each yields every record once
  • delete_all returns the affected row count
  • update_all returns rows changed
  • select narrows the loaded attributes
  • insert_all writes many rows in one statement
  • find_in_batches yields arrays of records
  • includes preloads associations to avoid N+1
  • any? checks existence cheaply
  • Aggregating a filtered relation with sum
  • before_validation runs before presence checks
  • Reading a column default from the schema
  • Strong parameters filtering
  • Nested params access
  • params.fetch with a default
  • Converting a param to a number
  • Indifferent access in params
  • Permitting array params
  • Safe nested lookups with dig
  • Handling blank params
  • Casting checkbox params to booleans
  • Ready jobs in a queue
  • Retry attempts exhausted
  • Lowest priority number wins
  • Preventing duplicate enqueues
  • Exponential backoff delays
  • Counting queued jobs in a table
  • Scheduled jobs that are not due yet
  • Dead letter after exhausted retries
  • Draining a queue up to worker capacity
  • Params values are strings
  • Priority ordering in a job queue