Hi Dave, I really appreciate the effort in putting into this.
I am having a challenge with .methods, when I call the book or the shelf methods the output is totally different, what could be the issue?
03:0> @book.methods
:shelf_ids=,
:shelves,
:authors,
:description,
:authors=,
:id_came_from_user?,
:id_previously_changed?,
:id_changed?,
:id_change,
:id_will_change!,
:id_previous_change,
:id_previously_was,
:restore_id!,
:clear_id_change,
:saved_change_to_id?,
:saved_change_to_id,
:id_before_last_save,
:will_save_change_to_id?,
:id_change_to_be_saved,
:title_before_type_cast,
:title_for_database,
:title_came_from_user?,
:title?,
:title_previously_changed?,
:title_changed?,
:title_change,
:title_will_change!,
:title_was,
:title_previous_change,
:title_previously_was,
:restore_title!,
:clear_title_change,
:saved_change_to_title?,
:saved_change_to_title,
:title_before_last_save,
:will_save_change_to_title?,
:title_change_to_be_saved,
:title_in_database,
:authors_before_type_cast,
:authors_for_database,
:authors_came_from_user?,
:authors?,
:authors_previously_changed?,
:authors_changed?,
:authors_change,
:authors_will_change!,
:authors_was,
:authors_previous_change,
:authors_previously_was,
:restore_authors!,
:clear_authors_change,
:saved_change_to_authors?,
:saved_change_to_authors,
:authors_before_last_save,
:will_save_change_to_authors?,
:authors_change_to_be_saved,
:authors_in_database,
:description_before_type_cast,
:description_for_database,
:description_came_from_user?,
:description?,
:description_previously_changed?,
:description_changed?,
:description_change,
:description_will_change!,
:description_was,
:description_previous_change,
:description_previously_was,
:restore_description!,
:clear_description_change,
:saved_change_to_description?,
:title,
:saved_change_to_description,
:description_before_last_save,
:will_save_change_to_description?,
:description_change_to_be_saved,
:description_in_database,
:page_count_before_type_cast,
:page_count_for_database,
:page_count_came_from_user?,
:page_count?,
:page_count_previously_changed?,
:page_count_changed?,
:page_count_change,
:page_count_will_change!,
:page_count_was,
:page_count_previous_change,
:page_count_previously_was,
:restore_page_count!,
:clear_page_count_change,
:saved_change_to_page_count?,
:saved_change_to_page_count,
:page_count_before_last_save,
:will_save_change_to_page_count?,
:page_count_change_to_be_saved,
:page_count_in_database,
:categories_before_type_cast,
:categories_for_database,
:categories_came_from_user?,
:categories?,
:categories_previously_changed?,
:categories_changed?,
:categories_change,
:categories_will_change!,
:categories_was,
:categories_previous_change,
:categories_previously_was,
:restore_categories!,
:clear_categories_change,
:saved_change_to_categories?,
:saved_change_to_categories,
:categories_before_last_save,
:will_save_change_to_categories?,
:categories_change_to_be_saved,
:categories_in_database,
:image_links_before_type_cast,
:image_links_for_database,
:image_links_came_from_user?,
:image_links?,
:image_links_previously_changed?,
:image_links_changed?,
:image_links_change,
:image_links_will_change!,
:image_links_was,
:image_links_previous_change,
:image_links_previously_was,
:restore_image_links!,
:clear_image_links_change,
:saved_change_to_image_links?,
:saved_change_to_image_links,
:image_links_before_last_save,
:will_save_change_to_image_links?,
:image_links_change_to_be_saved,
:image_links_in_database,
:created_at_before_type_cast,
:created_at_for_database,
:created_at_came_from_user?,
:created_at?,
:created_at_previously_changed?,
:created_at_changed?,
:created_at_change,
:created_at_will_change!,
:created_at_was,
:created_at_previous_change,
:created_at_previously_was,
:restore_created_at!,
:clear_created_at_change,
:saved_change_to_created_at?,
:saved_change_to_created_at,
:created_at_before_last_save,
:will_save_change_to_created_at?,
:created_at_change_to_be_saved,
:created_at_in_database,
:updated_at_for_database,
:updated_at?,
:updated_at_changed?,
:updated_at_change,
:updated_at_will_change!,
:updated_at_was,
:updated_at_previous_change,
:updated_at_previously_was,
:restore_updated_at!,
:clear_updated_at_change,
:saved_change_to_updated_at?,
:saved_change_to_updated_at,
:updated_at_before_last_save,
:will_save_change_to_updated_at?,
:updated_at_change_to_be_saved,
:updated_at_in_database,
:updated_at_previously_changed?,
:page_count=,
:categories=,
:page_count,
:categories,
:image_links,
:created_at=,
:updated_at=,
:image_links=,
:description=,
:updated_at,
:updated_at_before_type_cast,
:title=,
:updated_at_came_from_user?,
:created_at,
:encrypt,
:decrypt,
:logger,
:_update_callbacks,
:_destroy_callbacks,
:record_timestamps=,
:attribute_method_matchers,
:defined_enums?,
:encrypted_attributes,
:destroy_association_async_job,
:primary_key_prefix_type,
:encrypted_attributes?,
:attachment_reflections,
:table_name_prefix,
:_reflections,
:aggregate_reflections,
:automatic_scope_inversing,
:default_role,
:default_shard,
:_run_initialize_callbacks,
:_run_find_callbacks,
:table_name_suffix,
:primary_key_prefix_type?,
:_validate_callbacks,
:table_name_prefix?,
:_validators?,
:logger?,
:table_name_suffix?,
:attachment_reflections?,
:default_connection_handler?,
:pluralize_table_names?,
:default_role?,
:default_shard?,
:store_full_class_name,
:store_full_sti_class,
:lock_optimistically,
:lock_optimistically?,
:attribute_aliases?,
:store_full_class_name?,
:nested_attributes_options,
:attribute_method_matchers?,
:store_full_sti_class?,
:pluralize_table_names,
:default_scopes,
:default_scope_override,
:defined_enums,
:record_timestamps,
:time_zone_aware_attributes,
:skip_time_zone_conversion_for_attributes,
:time_zone_aware_types,
:nested_attributes_options?,
:time_zone_aware_attributes?,
:skip_time_zone_conversion_for_attributes?,
:time_zone_aware_types?,
:partial_updates,
:partial_inserts,
:cache_versioning,
:callbacks,
:partial_updates?,
:partial_inserts?,
:_run_commit_callbacks,
:_run_rollback_callbacks,
:_run_before_commit_callbacks,
:cache_timestamp_format,
:collection_cache_versioning,
:_rollback_callbacks,
:_commit_callbacks,
:cache_timestamp_format?,
:_before_commit_callbacks,
:cache_versioning?,
:collection_cache_versioning?,
:default_connection_handler,
:validation_context,
:_validators,
:model_name,
:_reflections?,
:aggregate_reflections?,
:automatic_scope_inversing?,
:_run_validate_callbacks,
:include_root_in_json,
:signed_id_verifier_secret,
:include_root_in_json?,
:_run_validation_callbacks,
:attribute_aliases,
:type_for_attribute,
:_run_destroy_callbacks,
:record_timestamps?,
:_run_touch_callbacks,
:_run_save_callbacks,
:_run_create_callbacks,
:_run_update_callbacks,
:_validation_callbacks,
:_initialize_callbacks,
:callbacks?,
:_find_callbacks,
:signed_id_verifier_secret?,
:_touch_callbacks,
:encrypted_attributes=,
:column_for_attribute,
:_save_callbacks,
:_create_callbacks,
:attachment_changes,
:reload,
:changed_for_autosave?,
:to_global_id,
:to_gid,
:to_signed_global_id,
:to_sgid,
:to_sgid_param,
:to_gid_param,
:encrypted_attribute?,
:ciphertext_for,
:save,
:save!,
:signed_id,
:serializable_hash,
:as_json,
:from_json,
:read_attribute_for_serialization,
:attribute_names,
:touch,
:no_touching?,
:touch_later,
:before_committed!,
:destroy,
:rolledback!,
:trigger_transactional_callbacks?,
:transaction,
:with_transaction_returning_status,
:committed!,
:_destroy,
:mark_for_destruction,
:destroyed_by_association=,
:marked_for_destruction?,
:destroyed_by_association,
:association,
:association_cached?,
:increment!,
:will_save_change_to_attribute?,
:saved_change_to_attribute?,
:saved_change_to_attribute,
:attribute_before_last_save,
:saved_changes?,
:saved_changes,
:has_changes_to_save?,
:attribute_change_to_be_saved,
:changes_to_save,
:changed_attribute_names_to_save,
:attributes_in_database,
:attribute_in_database,
:changes,
:previous_changes,
:changed,
:clear_changes_information,
:changed?,
:attribute_changed_in_place?,
:clear_attribute_changes,
:changes_applied,
:attribute_changed?,
:attribute_previously_changed?,
:attribute_previously_was,
:restore_attributes,
:attribute_was,
:changed_attributes,
:id_in_database,
:to_key,
:id_for_database,
:id=,
:id?,
:id_was,
:id,
:id_before_type_cast,
:query_attribute,
:read_attribute_before_type_cast,
:attributes_before_type_cast,
:attributes_for_database,
:_write_attribute,
:write_attribute,
:read_attribute,
:_read_attribute,
:attributes,
:_has_attribute?,
:attribute_for_inspect,
:[],
:[]=,
:attribute_present?,
:accessed_fields,
:respond_to?,
:has_attribute?,
:method_missing,
:respond_to_without_attributes?,
:attribute_missing,
:lock!,
:with_lock,
:locking_enabled?,
:valid?,
:validate,
:validates_inclusion_of,
:validates_numericality_of,
:validates_presence_of,
:validates_length_of,
:validates_confirmation_of,
:validates_size_of,
:validates_absence_of,
:validates_comparison_of,
:validates_exclusion_of,
:validates_acceptance_of,
:validates_format_of,
:run_callbacks,
:errors,
:read_attribute_for_validation,
:validates_with,
:validate!,
:invalid?,
:cache_key_with_version,
:cache_key,
:cache_version,
:to_param,
:to_model,
:to_partial_path,
:assign_attributes,
:attributes=,
:populate_with_current_scope_attributes,
:initialize_internals_callback,
:decrement!,
:toggle,
:toggle!,
:persisted?,
:update!,
:delete,
:previously_new_record?,
:previously_persisted?,
:destroyed?,
:destroy!,
:becomes,
:becomes!,
:increment,
:decrement,
:update_attribute,
:update,
:update_column,
:update_columns,
:new_record?,
:strict_loading!,
:strict_loading_mode,
:strict_loading_n_plus_one_only?,
:<=>,
:readonly!,
:==,
:blank?,
:pretty_print,
:values_at,
:eql?,
:readonly?,
:present?,
:encode_with,
:freeze,
:inspect,
:slice,
:strict_loading?,
:connection_handler,
:frozen?,
:init_with_attributes,
:init_with,
:hash,
:untaint,
:require_dependency,
:to_json,
:instance_values,
:instance_variable_names,
:in?,
:presence_in,
:binding,
:to_yaml,
:presence,
:deep_dup,
:with_options,
:acts_like?,
:duplicable?,
:html_safe?,
:to_query,
:pry,
:pretty_print_inspect,
:pretty_print_cycle,
:pretty_print_instance_variables,
:try!,
:try,
:singleton_class,
:dup,
:itself,
:taint,
:tainted?,
:untrust,
:untrusted?,
:trust,
:methods,
:singleton_methods,
:protected_methods,
:private_methods,
:public_methods,
:instance_variables,
:instance_variable_get,
:instance_variable_set,
:instance_variable_defined?,
:remove_instance_variable,
:instance_of?,
:kind_of?,
:is_a?,
:display,
:pretty_inspect,
:class,
:tap,
:then,
:yield_self,
:gem,
:public_send,
:class_eval,
:extend,
:clone,
:method,
:public_method,
:singleton_method,
:define_singleton_method,
:===,
:=~,
:!~,
:nil?,
:object_id,
:send,
=>
[:autosave_associated_records_for_shelvings,
:validate_associated_records_for_shelvings,
:autosave_associated_records_for_books,
:validate_associated_records_for_books,
:books,ce_eval,
:shelving_ids,,
:shelvings=,
:shelving_ids=,
:book_ids,
:books=,:004:0> @shelf.methods
:shelvings,
:book_ids=,
:clear_created_at_change,
:saved_change_to_created_at?,
:created_at_previous_change,
:created_at_previously_changed?,
:restore_created_at!,
:created_at_change_to_be_saved,
:created_at_in_database,
:saved_change_to_created_at,
:created_at_before_last_save,
:created_at_previously_was,
:updated_at_changed?,
:updated_at_change,
:updated_at_for_database,
:updated_at?,
:updated_at_previously_changed?,
:will_save_change_to_created_at?,
:restore_updated_at!,
:updated_at_will_change!,
:updated_at_was,
:updated_at_previous_change,
:updated_at_previously_was,
:will_save_change_to_updated_at?,
:clear_updated_at_change,
:saved_change_to_updated_at?,
:saved_change_to_updated_at,
:updated_at_before_last_save,
:updated_at,
:name_before_type_cast,
:name_for_database,
:name_came_from_user?,
:name?,
:name_previously_changed?,
:name_changed?,
:name_change,
:name_will_change!,
:name_was,
:name_previous_change,
:name_previously_was,
:restore_name!,
:clear_name_change,
:saved_change_to_name?,
:saved_change_to_name,
:name_before_last_save,
:will_save_change_to_name?,
:name_change_to_be_saved,
:name_in_database,
:updated_at=,
:updated_at_before_type_cast,
:updated_at_change_to_be_saved,
:updated_at_in_database,
:updated_at_came_from_user?,
:name=,
:created_at=,
:created_at,
:name,
:id_came_from_user?,
:created_at_for_database,
:created_at_came_from_user?,
:created_at?,
:id_previously_changed?,
:id_changed?,
:created_at_change,
:created_at_will_change!,
:created_at_was,
:id_change,
:id_will_change!,
:id_previous_change,
:id_previously_was,
:restore_id!,
:clear_id_change,
:saved_change_to_id?,
:saved_change_to_id,
:id_before_last_save,
:will_save_change_to_id?,
:id_change_to_be_saved,
:created_at_changed?,
:created_at_before_type_cast,
:encrypt,
:decrypt,
:logger,
:_update_callbacks,
:_destroy_callbacks,
:record_timestamps=,
:attribute_method_matchers,
:defined_enums?,
:encrypted_attributes,
:destroy_association_async_job,
:primary_key_prefix_type,
:encrypted_attributes?,
:attachment_reflections,
:table_name_prefix,
:_reflections,
:aggregate_reflections,
:automatic_scope_inversing,
:default_role,
:default_shard,
:_run_initialize_callbacks,
:_run_find_callbacks,
:table_name_suffix,
:primary_key_prefix_type?,
:_validate_callbacks,
:table_name_prefix?,
:_validators?,
:logger?,
:table_name_suffix?,
:attachment_reflections?,
:default_connection_handler?,
:pluralize_table_names?,
:default_role?,
:default_shard?,
:store_full_class_name,
:store_full_sti_class,
:lock_optimistically,
:lock_optimistically?,
:attribute_aliases?,
:store_full_class_name?,
:nested_attributes_options,
:attribute_method_matchers?,
:store_full_sti_class?,
:pluralize_table_names,
:default_scopes,
:default_scope_override,
:defined_enums,
:record_timestamps,
:time_zone_aware_attributes,
:skip_time_zone_conversion_for_attributes,
:time_zone_aware_types,
:nested_attributes_options?,
:time_zone_aware_attributes?,
:skip_time_zone_conversion_for_attributes?,
:time_zone_aware_types?,
:partial_updates,
:partial_inserts,
:cache_versioning,
:callbacks,
:partial_updates?,
:partial_inserts?,
:_run_commit_callbacks,
:_run_rollback_callbacks,
:_run_before_commit_callbacks,
:cache_timestamp_format,
:collection_cache_versioning,
:_rollback_callbacks,
:_commit_callbacks,
:cache_timestamp_format?,
:_before_commit_callbacks,
:cache_versioning?,
:collection_cache_versioning?,
:default_connection_handler,
:validation_context,
:_validators,
:model_name,
:_reflections?,
:aggregate_reflections?,
:automatic_scope_inversing?,
:_run_validate_callbacks,
:include_root_in_json,
:signed_id_verifier_secret,
:include_root_in_json?,
:_run_validation_callbacks,
:attribute_aliases,
:type_for_attribute,
:_run_destroy_callbacks,
:record_timestamps?,
:_run_touch_callbacks,
:_run_save_callbacks,
:_run_create_callbacks,
:_run_update_callbacks,
:_validation_callbacks,
:_initialize_callbacks,
:callbacks?,
:_find_callbacks,
:signed_id_verifier_secret?,
:_touch_callbacks,
:encrypted_attributes=,
:column_for_attribute,
:_save_callbacks,
:_create_callbacks,
:attachment_changes,
:reload,
:changed_for_autosave?,
:to_global_id,
:to_gid,
:to_signed_global_id,
:to_sgid,
:to_sgid_param,
:to_gid_param,
:encrypted_attribute?,
:ciphertext_for,
:save,
:save!,
:signed_id,
:serializable_hash,
:as_json,
:from_json,
:read_attribute_for_serialization,
:attribute_names,
:touch,
:no_touching?,
:touch_later,
:before_committed!,
:destroy,
:rolledback!,
:trigger_transactional_callbacks?,
:transaction,
:with_transaction_returning_status,
:committed!,
:_destroy,
:mark_for_destruction,
:destroyed_by_association=,
:marked_for_destruction?,
:destroyed_by_association,
:association,
:association_cached?,
:increment!,
:will_save_change_to_attribute?,
:saved_change_to_attribute?,
:saved_change_to_attribute,
:attribute_before_last_save,
:saved_changes?,
:saved_changes,
:has_changes_to_save?,
:attribute_change_to_be_saved,
:changes_to_save,
:changed_attribute_names_to_save,
:attributes_in_database,
:attribute_in_database,
:changes,
:previous_changes,
:changed,
:clear_changes_information,
:changed?,
:attribute_changed_in_place?,
:clear_attribute_changes,
:changes_applied,
:attribute_changed?,
:attribute_previously_changed?,
:attribute_previously_was,
:restore_attributes,
:attribute_was,
:changed_attributes,
:id_in_database,
:to_key,
:id_for_database,
:id=,
:id?,
:id_was,
:id,
:id_before_type_cast,
:query_attribute,
:read_attribute_before_type_cast,
:attributes_before_type_cast,
:attributes_for_database,
:_write_attribute,
:write_attribute,
:read_attribute,
:_read_attribute,
:attributes,
:_has_attribute?,
:attribute_for_inspect,
:[],
:[]=,
:attribute_present?,
:accessed_fields,
:respond_to?,
:has_attribute?,
:method_missing,
:respond_to_without_attributes?,
:attribute_missing,
:lock!,
:with_lock,
:locking_enabled?,
:valid?,
:validate,
:validates_inclusion_of,
:validates_numericality_of,
:validates_presence_of,
:validates_length_of,
:validates_confirmation_of,
:validates_size_of,
:validates_absence_of,
:validates_comparison_of,
:validates_exclusion_of,
:validates_acceptance_of,
:validates_format_of,
:run_callbacks,
:errors,
:read_attribute_for_validation,
:validates_with,
:validate!,
:invalid?,
:cache_key_with_version,
:cache_key,
:cache_version,
:to_param,
:to_model,
:to_partial_path,
:assign_attributes,
:attributes=,
:populate_with_current_scope_attributes,
:initialize_internals_callback,
:decrement!,
:toggle,
:toggle!,
:persisted?,
:update!,
:delete,
:previously_new_record?,
:previously_persisted?,
:destroyed?,
:destroy!,
:becomes,
:becomes!,
:increment,
:decrement,
:update_attribute,
:update,
:update_column,
:update_columns,
:new_record?,
:strict_loading!,
:strict_loading_mode,
:strict_loading_n_plus_one_only?,
:<=>,
:readonly!,
:==,
:blank?,
:pretty_print,
:values_at,
:eql?,
:readonly?,
:present?,
:encode_with,
:freeze,
:inspect,
:slice,
:strict_loading?,
:connection_handler,
:frozen?,
:init_with_attributes,
:init_with,
:hash,
:untaint,
:require_dependency,
:to_json,
:instance_values,
:instance_variable_names,
:in?,
:presence_in,
:binding,
:to_yaml,
:presence,
:deep_dup,
:with_options,
:acts_like?,
:duplicable?,
:html_safe?,
:to_query,
:pry,
:pretty_print_inspect,
:pretty_print_cycle,
:pretty_print_instance_variables,
:try!,
:try,
:singleton_class,
:dup,
:itself,
:taint,
:tainted?,
:untrust,
:untrusted?,
:trust,
:methods,
:singleton_methods,
:protected_methods,
:private_methods,
:public_methods,
:instance_variables,
:instance_variable_get,
:instance_variable_set,
:instance_variable_defined?,
:remove_instance_variable,
:instance_of?,
:kind_of?,
:is_a?,
:display,
:pretty_inspect,
:class,
:tap,
:then,
:yield_self,
:gem,
:public_send,
:class_eval,
:extend,
:clone,
:method,
:public_method,
:singleton_method,
:define_singleton_method,
:===,
:=~,
:!~,
:nil?,
:object_id,
:send,
:to_enum,
:enum_for,
:to_s,
:send,
:!,
:instance_eval,
:instance_exec,
:!=,
:equal?,
:id]