Step 3 / Select topic Rails Hard
What this bank covers
- where.not and NULL columns
- sum on an empty relation
- last on a limited relation
- joins produces duplicate parent rows
- Combining conditions with or
- count(*) versus count(column)
- find_by versus find_by!
- update_all bypasses validations
- group with sum and NULL values
- size versus count on relations
- dependent: :nullify on has_many
- inverse_of shares the owner object
- has_many :through returns one row per join row
- Replacing a has_one nullifies the old record
- dependent on the join model only removes join rows
- Self-referential has_many
- Appending to a has_many on an unsaved parent
- Polymorphic has_many filters on type too
- Association scopes seed attributes on create
- belongs_to touch: true
- Callback order on create
- valid? triggers validation callbacks
- Returning false no longer halts a callback chain
- Multiple validators on one attribute
- save(validate: false) skips validations only
- Full messages prepend the humanized attribute
- Save callbacks are skipped when validation fails
- update_column bypasses callbacks and validations
- throw :abort halts destroy
- The on: :create validation context
- column_names after t.timestamps
- create_table id: false
- Typed column defaults
- Decimal columns cast to BigDecimal
- reset_column_information
- t.references column naming
- t.timestamps and NOT NULL
- String column limit in the schema
- Custom primary key in create_table
- Default index names
- with_indifferent_access is deep
- in_groups_of without padding
- Adding a month duration to a date
- String#truncate counts the omission
- Object#blank? and zero
- to_sentence connectors
- Inflector rules for -sis words
- Hash#deep_merge
- Integer#ordinalize and the teens
- ActiveSupport::Concern included and class_methods blocks
- Polynomial backoff waits
- Non-idempotent job body
- Priority then enqueue order
- Database-level job deduplication
- Attempts count total executions
- Enqueuing inside a rolled-back transaction
- Deserializing a deleted record
- wait versus wait_until
- Atomic claiming with update_all
- Serialized job arguments lose symbols
- MessageVerifier rejects tampered tokens
- fixed_length_secure_compare demands equal lengths
- Bind placeholders quote user input
- sanitize_sql_like neutralises wildcards
- Which characters html_escape replaces
- Purpose binding in MessageVerifier
- SecureRandom.hex argument is byte count
- String interpolation opens an injection hole
- ParameterFilter matches nested and partial keys
- fixed_length_secure_compare vs secure_compare
- includes preloads in a second query
- pluck selects a single column
- find_each batching math
- counter caches make size free
- partial selects and missing attributes
- update_all skips the model layer
- joins does not eager load
- eager_load builds one outer join
- pluck on a loaded relation
- the ActiveRecord query cache
- Routes created by a resourceful route
- Route order decides the winner
- Nested resource paths
- Shallow nesting
- Member versus collection routes
- path: versus as:
- Segment constraints are matched against the whole segment
- scope module: changes the controller only
- only: restricts the helpers too
- Wildcard segments and the format
- permit only keeps scalars for bare keys
- key: [] requires every element to be a scalar
- nil and empty strings are permitted scalars
- require with an array of keys
- key: {} permits an arbitrary nested hash
- permit filters each hash in an array
- permit! is recursive
- Bare keys never permit arrays
- to_unsafe_h converts deeply
- except/slice inherit permitted status