Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [2] pry(main)> first_post = Post.first
- Post Load (0.2ms) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT 1
- => #<Post:0x00000004cf8f38 id: 1, title: "First Post", body: "This is the first post in our system", created_at: Thu, 26 May 2016 00:58:20 UTC +00:00, updated_at: Thu, 26 May 2016 00:58:20 UTC +00:00>
- [3] pry(main)> p first_post
- #<Post id: 1, title: "First Post", body: "This is the first post in our system", created_at: "2016-05-26 00:58:20", updated_at: "2016-05-26 00:58:20">
- => #<Post:0x00000004cf8f38 id: 1, title: "First Post", body: "This is the first post in our system", created_at: Thu, 26 May 2016 00:58:20 UTC +00:00, updated_at: Thu, 26 May 2016 00:58:20 UTC +00:00>
- [4] pry(main)> cd Post.first
- Post Load (0.3ms) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT 1
- [5] pry(#<Post>):1> self.methods.sort
- => [:!,
- :!=,
- :!~,
- :<=>,
- :==,
- :===,
- :=~,
- :[],
- :[]=,
- :__binding__,
- :__id__,
- :__pry__,
- :__send__,
- :_commit_callbacks,
- :_commit_callbacks=,
- :_commit_callbacks?,
- :_create_callbacks,
- :_create_callbacks=,
- :_create_callbacks?,
- :_destroy,
- :_destroy_callbacks,
- :_destroy_callbacks=,
- :_destroy_callbacks?,
- :_find_callbacks,
- :_find_callbacks=,
- :_find_callbacks?,
- :_initialize_callbacks,
- :_initialize_callbacks=,
- :_initialize_callbacks?,
- :_read_attribute,
- :_reflections,
- :_reflections=,
- :_reflections?,
- :_rollback_callbacks,
- :_rollback_callbacks=,
- :_rollback_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,
- :_save_callbacks=,
- :_save_callbacks?,
- :_touch_callbacks,
- :_touch_callbacks=,
- :_touch_callbacks?,
- :_update_callbacks,
- :_update_callbacks=,
- :_update_callbacks?,
- :_validate_callbacks,
- :_validate_callbacks=,
- :_validate_callbacks?,
- :_validation_callbacks,
- :_validation_callbacks=,
- :_validation_callbacks?,
- :_validators,
- :_validators=,
- :_validators?,
- :`,
- :acts_like?,
- :actually_destroyed?,
- :add_to_transaction,
- :after_add_for_comments,
- :after_add_for_comments=,
- :after_add_for_comments?,
- :after_remove_for_comments,
- :after_remove_for_comments=,
- :after_remove_for_comments?,
- :aggregate_reflections,
- :aggregate_reflections=,
- :aggregate_reflections?,
- :arel_attributes_with_values_for_create,
- :arel_attributes_with_values_for_update,
- :as_json,
- :assign_attributes,
- :association,
- :association_cache,
- :attribute_aliases,
- :attribute_aliases?,
- :attribute_changed?,
- :attribute_changed_in_place?,
- :attribute_for_inspect,
- :attribute_method?,
- :attribute_method_matchers,
- :attribute_method_matchers?,
- :attribute_missing,
- :attribute_names,
- :attribute_present?,
- :attribute_was,
- :attributes,
- :attributes=,
- :attributes_before_type_cast,
- :attributes_changed_by_setter,
- :autosave_associated_records_for_comments,
- :becomes,
- :becomes!,
- :before_add_for_comments,
- :before_add_for_comments=,
- :before_add_for_comments?,
- :before_remove_for_comments,
- :before_remove_for_comments=,
- :before_remove_for_comments?,
- :blank?,
- :body,
- :body=,
- :body?,
- :body_before_type_cast,
- :body_came_from_user?,
- :body_change,
- :body_changed?,
- :body_was,
- :body_will_change!,
- :cache_key,
- :cache_timestamp_format,
- :cache_timestamp_format?,
- :capture,
- :changed,
- :changed?,
- :changed_attributes,
- :changed_for_autosave?,
- :changes,
- :changes_applied,
- :class,
- :class_eval,
- :clear_aggregation_cache,
- :clear_association_cache,
- :clear_changes_information,
- :clear_destroy_state,
- :clear_transaction_record_state,
- :clone,
- :clone_attribute_value,
- :column_for_attribute,
- :comment_ids,
- :comment_ids=,
- :comments,
- :comments=,
- :committed!,
- :concern,
- :connection_handler,
- :created_at,
- :created_at=,
- :created_at?,
- :created_at_before_type_cast,
- :created_at_came_from_user?,
- :created_at_change,
- :created_at_changed?,
- :created_at_was,
- :created_at_will_change!,
- :decrement,
- :decrement!,
- :deep_dup,
- :default_connection_handler,
- :default_connection_handler?,
- :default_scopes,
- :default_timezone,
- :define_singleton_method,
- :defined_enums,
- :defined_enums=,
- :defined_enums?,
- :delete,
- :destroy,
- :destroy!,
- :destroyed?,
- :destroyed_by_association,
- :destroyed_by_association=,
- :display,
- :dump_schema_after_migration,
- :dup,
- :duplicable?,
- :enable_warnings,
- :encode_with,
- :enum_for,
- :eql?,
- :equal?,
- :errors,
- :extend,
- :find_by_statement_cache,
- :find_by_statement_cache=,
- :find_by_statement_cache?,
- :force_clear_transaction_record_state,
- :freeze,
- :from_json,
- :from_xml,
- :frozen?,
- :gem,
- :has_attribute?,
- :hash,
- :html_safe?,
- :id,
- :id=,
- :id?,
- :id_before_type_cast,
- :id_came_from_user?,
- :id_change,
- :id_changed?,
- :id_was,
- :id_will_change!,
- :in?,
- :include_root_in_json,
- :include_root_in_json=,
- :include_root_in_json?,
- :increment,
- :increment!,
- :init_with,
- :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?,
- :load_dependency,
- :lock!,
- :lock_optimistically,
- :lock_optimistically?,
- :locking_enabled?,
- :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_writes,
- :partial_writes?,
- :perform_validations,
- :persistable_attribute_names,
- :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,
- :primary_key_prefix_type,
- :private_methods,
- :protected_methods,
- :pry,
- :psych_to_yaml,
- :public_method,
- :public_methods,
- :public_send,
- :query_attribute,
- :quietly,
- :quoted_id,
- :raise_in_transactional_callbacks,
- :raise_record_invalid,
- :read_attribute,
- :read_attribute_before_type_cast,
- :read_attribute_for_serialization,
- :read_attribute_for_validation,
- :read_store_attribute,
- :readonly!,
- :readonly?,
- :record_timestamps,
- :record_timestamps=,
- :record_timestamps?,
- :reload,
- :remember_transaction_record_state,
- :remove_instance_variable,
- :require_dependency,
- :require_or_load,
- :reset_body!,
- :reset_created_at!,
- :reset_id!,
- :reset_title!,
- :reset_updated_at!,
- :respond_to?,
- :respond_to_without_attributes?,
- :restore_attributes,
- :restore_body!,
- :restore_created_at!,
- :restore_id!,
- :restore_title!,
- :restore_transaction_record_state,
- :restore_updated_at!,
- :rollback_active_record_state!,
- :rolledback!,
- :run_callbacks,
- :run_validations!,
- :sanitize_for_mass_assignment,
- :sanitize_forbidden_attributes,
- :save,
- :save!,
- :schema_format,
- :send,
- :serializable_hash,
- :silence,
- :silence_stderr,
- :silence_stream,
- :silence_warnings,
- :singleton_class,
- :singleton_method,
- :singleton_methods,
- :skip_time_zone_conversion_for_attributes,
- :skip_time_zone_conversion_for_attributes?,
- :slice,
- :store_full_sti_class,
- :store_full_sti_class?,
- :suppress,
- :suppress_warnings,
- :table_name_prefix,
- :table_name_prefix?,
- :table_name_suffix,
- :table_name_suffix?,
- :taint,
- :tainted?,
- :tap,
- :time_zone_aware_attributes,
- :timestamped_migrations,
- :title,
- :title=,
- :title?,
- :title_before_type_cast,
- :title_came_from_user?,
- :title_change,
- :title_changed?,
- :title_was,
- :title_will_change!,
- :to_enum,
- :to_gid,
- :to_gid_param,
- :to_global_id,
- :to_json,
- :to_json_with_active_support_encoder,
- :to_json_without_active_support_encoder,
- :to_key,
- :to_model,
- :to_param,
- :to_partial_path,
- :to_query,
- :to_s,
- :to_sgid,
- :to_sgid_param,
- :to_signed_global_id,
- :to_xml,
- :to_yaml,
- :to_xml,
- :to_yaml,
- :to_yaml_properties,
- :toggle,
- :toggle!,
- :touch,
- :transaction,
- :transaction_include_any_action?,
- :transaction_record_state,
- :trust,
- :try,
- :try!,
- :type_for_attribute,
- :unloadable,
- :untaint,
- :untrust,
- :untrusted?,
- :update,
- :update!,
- :update_attribute,
- :update_attributes,
- :update_attributes!,
- :update_column,
- :update_columns,
- :updated_at,
- :updated_at=,
- :updated_at?,
- :updated_at_before_type_cast,
- :updated_at_came_from_user?,
- :updated_at_change,
- :updated_at_changed?,
- :updated_at_was,
- :updated_at_will_change!,
- :valid?,
- :validate,
- :validate!,
- :validate_associated_records_for_comments,
- :validates_absence_of,
- :validates_acceptance_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,
- :validation_context=,
- :with_lock,
- :with_options,
- :with_transaction_returning_status,
- :with_warnings,
- :write_store_attribute]
- [6] pry(#<Post>):1> nesting
- Nesting status:
- --
- 0. main (Pry top level)
- 1. #<Post>
- [7] pry(#<Post>):1> self.title = "First Post Title"
- => "First Post Title"
- [8] pry(#<Post>):1> self.body = "First Post Body"
- => "First Post Body"
- [9] pry(#<Post>):1> save!
- (0.1ms) begin transaction
- SQL (2.2ms) UPDATE "posts" SET "title" = ?, "body" = ?, "updated_at" = ? WHERE "posts"."id" = ? [["title", "First Post Title"], ["body", "First Post Body"], ["updated_at", "2016-05-26 23:05:22.184535"], ["id", 1]]
- (120.2ms) commit transaction
- => true
- [10] pry(#<Post>):1> self
- => #<Post:0x00000004bb76b0 id: 1, title: "First Post Title", body: "First Post Body", created_at: Thu, 26 May 2016 00:58:20 UTC +00:00, updated_at: Thu, 26 May 2016 23:05:22 UTC +00:00>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement