Skip to content

Instantly share code, notes, and snippets.

@arielj
Created April 22, 2022 19:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arielj/592b2ea798f6f8098d30a31c8846b625 to your computer and use it in GitHub Desktop.
Save arielj/592b2ea798f6f8098d30a31c8846b625 to your computer and use it in GitHub Desktop.
ActiveRecord default instance methods in Rails 7.0
:!,
:!=,
:!~,
:<=>,
:==,
:===,
:=~,
:User,
:User=,
:User?,
:User_before_last_save,
:User_before_type_cast,
:User_came_from_user?,
:User_change,
:User_change_to_be_saved,
:User_changed?,
:User_for_database,
:User_in_database,
:User_previous_change,
:User_previously_changed?,
:User_previously_was,
:User_was,
:User_will_change!,
:[],
:[]=,
:__callbacks,
:__callbacks?,
:__id__,
:__send__,
:_before_commit_callbacks,
:_commit_callbacks,
:_create_callbacks,
:_destroy,
:_destroy_callbacks,
:_find_callbacks,
:_has_attribute?,
:_initialize_callbacks,
:_read_attribute,
:_reflections,
:_reflections?,
:_rollback_callbacks,
:_run_before_commit_callbacks,
:_run_commit_callbacks,
:_run_create_callbacks,
:_run_destroy_callbacks,
:_run_find_callbacks,
:_run_initialize_callbacks,
:_run_rollback_callbacks,
:_run_save_callbacks,
:_run_touch_callbacks,
:_run_update_callbacks,
:_run_validate_callbacks,
:_run_validation_callbacks,
:_save_callbacks,
:_touch_callbacks,
:_update_callbacks,
:_validate_callbacks,
:_validation_callbacks,
:_validators,
:_validators?,
:_write_attribute,
:`,
:accessed_fields,
:acts_like?,
:aggregate_reflections,
:aggregate_reflections?,
:as_json,
:assign_attributes,
:association,
:association_cached?,
:attachment_changes,
:attachment_reflections,
:attachment_reflections?,
:attribute_aliases,
:attribute_aliases?,
:attribute_before_last_save,
:attribute_change_to_be_saved,
:attribute_changed?,
:attribute_changed_in_place?,
:attribute_for_inspect,
:attribute_in_database,
:attribute_method_matchers,
:attribute_method_matchers?,
:attribute_missing,
:attribute_names,
:attribute_present?,
:attribute_previously_changed?,
:attribute_previously_was,
:attribute_was,
:attributes,
:attributes=,
:attributes_before_type_cast,
:attributes_for_database,
:attributes_in_database,
:automatic_scope_inversing,
:automatic_scope_inversing?,
:becomes,
:becomes!,
:before_committed!,
:blank?,
:broadcast_action,
:broadcast_action_later,
:broadcast_action_later_to,
:broadcast_action_to,
:broadcast_after_to,
:broadcast_append,
:broadcast_append_later,
:broadcast_append_later_to,
:broadcast_append_to,
:broadcast_before_to,
:broadcast_prepend,
:broadcast_prepend_later,
:broadcast_prepend_later_to,
:broadcast_prepend_to,
:broadcast_remove,
:broadcast_remove_to,
:broadcast_render,
:broadcast_render_later,
:broadcast_render_later_to,
:broadcast_render_to,
:broadcast_replace,
:broadcast_replace_later,
:broadcast_replace_later_to,
:broadcast_replace_to,
:broadcast_update,
:broadcast_update_later,
:broadcast_update_later_to,
:broadcast_update_to,
:cache_key,
:cache_key_with_version,
:cache_timestamp_format,
:cache_timestamp_format?,
:cache_version,
:cache_versioning,
:cache_versioning?,
:changed,
:changed?,
:changed_attribute_names_to_save,
:changed_attributes,
:changed_for_autosave?,
:changes,
:changes_applied,
:changes_to_save,
:ciphertext_for,
:class,
:class_eval,
:clear_User_change,
:clear_attribute_changes,
:clear_changes_information,
:clear_created_at_change,
:clear_id_change,
:clear_updated_at_change,
:clone,
:collection_cache_versioning,
:collection_cache_versioning?,
:column_for_attribute,
:committed!,
:connection_handler,
:created_at,
:created_at=,
:created_at?,
:created_at_before_last_save,
:created_at_before_type_cast,
:created_at_came_from_user?,
:created_at_change,
:created_at_change_to_be_saved,
:created_at_changed?,
:created_at_for_database,
:created_at_in_database,
:created_at_previous_change,
:created_at_previously_changed?,
:created_at_previously_was,
:created_at_was,
:created_at_will_change!,
:debugger,
:decrement,
:decrement!,
:decrypt,
:deep_dup,
:default_connection_handler,
:default_connection_handler?,
:default_role,
:default_role?,
:default_scope_override,
:default_scopes,
:default_shard,
:default_shard?,
:define_singleton_method,
:defined_enums,
:defined_enums?,
:delete,
:destroy,
:destroy!,
:destroy_association_async_job,
:destroyed?,
:destroyed_by_association,
:destroyed_by_association=,
:display,
:dup,
:duplicable?,
:encode_with,
:encrypt,
:encrypted_attribute?,
:encrypted_attributes,
:encrypted_attributes=,
:encrypted_attributes?,
:enum_for,
:eql?,
:equal?,
:errors,
:extend,
:freeze,
:from_json,
:frozen?,
:gem,
:has_attribute?,
:has_changes_to_save?,
:hash,
:html_safe?,
:id,
:id=,
:id?,
:id_before_last_save,
:id_before_type_cast,
:id_came_from_user?,
:id_change,
:id_change_to_be_saved,
:id_changed?,
:id_for_database,
:id_in_database,
:id_previous_change,
:id_previously_changed?,
:id_previously_was,
:id_was,
:id_will_change!,
:in?,
:include_root_in_json,
:include_root_in_json?,
:increment,
:increment!,
:init_with,
:init_with_attributes,
:initialize_internals_callback,
:inspect,
:instance_eval,
:instance_exec,
:instance_of?,
:instance_values,
:instance_variable_defined?,
:instance_variable_get,
:instance_variable_names,
:instance_variable_set,
:instance_variables,
:invalid?,
:is_a?,
:itself,
:kind_of?,
:lock!,
:lock_optimistically,
:lock_optimistically?,
:locking_enabled?,
:logger,
:logger?,
:mark_for_destruction,
:marked_for_destruction?,
:method,
:method_missing,
:methods,
:model_name,
:nested_attributes_options,
:nested_attributes_options?,
:new_record?,
:nil?,
:no_touching?,
:object_id,
:partial_inserts,
:partial_inserts?,
:partial_updates,
:partial_updates?,
:persisted?,
:pluralize_table_names,
:pluralize_table_names?,
:populate_with_current_scope_attributes,
:presence,
:presence_in,
:present?,
:pretty_inspect,
:pretty_print,
:pretty_print_cycle,
:pretty_print_inspect,
:pretty_print_instance_variables,
:previous_changes,
:previously_new_record?,
:previously_persisted?,
:primary_key_prefix_type,
:primary_key_prefix_type?,
:private_methods,
:protected_methods,
:public_method,
:public_methods,
:public_send,
:query_attribute,
:read_attribute,
:read_attribute_before_type_cast,
:read_attribute_for_serialization,
:read_attribute_for_validation,
:readonly!,
:readonly?,
:record_timestamps,
:record_timestamps=,
:record_timestamps?,
:reload,
:remove_instance_variable,
:require_dependency,
:respond_to?,
:respond_to_without_attributes?,
:restore_User!,
:restore_attributes,
:restore_created_at!,
:restore_id!,
:restore_updated_at!,
:rolledback!,
:run_callbacks,
:save,
:save!,
:saved_change_to_User,
:saved_change_to_User?,
:saved_change_to_attribute,
:saved_change_to_attribute?,
:saved_change_to_created_at,
:saved_change_to_created_at?,
:saved_change_to_id,
:saved_change_to_id?,
:saved_change_to_updated_at,
:saved_change_to_updated_at?,
:saved_changes,
:saved_changes?,
:send,
:serializable_hash,
:signed_id,
:signed_id_verifier_secret,
:signed_id_verifier_secret?,
:singleton_class,
:singleton_method,
:singleton_methods,
:skip_time_zone_conversion_for_attributes,
:skip_time_zone_conversion_for_attributes?,
:slice,
:store_full_class_name,
:store_full_class_name?,
:store_full_sti_class,
:store_full_sti_class?,
:strict_loading!,
:strict_loading?,
:strict_loading_mode,
:strict_loading_n_plus_one_only?,
:table_name_prefix,
:table_name_prefix?,
:table_name_suffix,
:table_name_suffix?,
:taint,
:tainted?,
:tap,
:then,
:time_zone_aware_attributes,
:time_zone_aware_attributes?,
:time_zone_aware_types,
:time_zone_aware_types?,
:to_enum,
:to_gid,
:to_gid_param,
:to_global_id,
:to_json,
:to_key,
:to_model,
:to_param,
:to_partial_path,
:to_query,
:to_s,
:to_sgid,
:to_sgid_param,
:to_signed_global_id,
:to_yaml,
:toggle,
:toggle!,
:touch,
:touch_later,
:transaction,
:trap,
:trigger_transactional_callbacks?,
:trust,
:try,
:try!,
:type_for_attribute,
:untaint,
:untrust,
:untrusted?,
:update,
:update!,
:update_attribute,
:update_column,
:update_columns,
:updated_at,
:updated_at=,
:updated_at?,
:updated_at_before_last_save,
:updated_at_before_type_cast,
:updated_at_came_from_user?,
:updated_at_change,
:updated_at_change_to_be_saved,
:updated_at_changed?,
:updated_at_for_database,
:updated_at_in_database,
:updated_at_previous_change,
:updated_at_previously_changed?,
:updated_at_previously_was,
:updated_at_was,
:updated_at_will_change!,
:valid?,
:validate,
:validate!,
:validates_absence_of,
:validates_acceptance_of,
:validates_comparison_of,
:validates_confirmation_of,
:validates_exclusion_of,
:validates_format_of,
:validates_inclusion_of,
:validates_length_of,
:validates_numericality_of,
:validates_presence_of,
:validates_size_of,
:validates_with,
:validation_context,
:values_at,
:will_save_change_to_User?,
:will_save_change_to_attribute?,
:will_save_change_to_created_at?,
:will_save_change_to_id?,
:will_save_change_to_updated_at?,
:with_lock,
:with_options,
:with_transaction_returning_status,
:write_attribute,
:yield_self
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment