I have searched about in SO for Object doesn't not support inspect error
and some of the links include this one here and this one too . There many more, and on github as well, but they all do not address the cause.
I have my model here
class Tool < ActiveRecord::Base
include PublicActivity::Common
after_initialize :defaults
after_save :explicit_updates
belongs_to :job
belongs_to :kind
has_one :location, :through => :job
has_one :rig, :through => :job
belongs_to :vendor
has_paper_trail
scope :deployable_by_type, ->(kind_id) { where(status: "deployable",
kind_id: kind_id)}
scope :deployable, -> { where(status: "deployable")}
scope :deployed, -> { where(status: "deployed")}
scope :in_transit, -> { where(status: "in_transit")}
scope :under_maintenace, -> { where(maintenance_status: true)}
scope :failed, -> { where(failed: true)}
scope :requiring_service, -> { where(service_required: true,
maintenance_status: false)}
validates :kind_id, presence: true
validates :serial_number, presence: true
validates :department, presence: true
validates :size, presence: true, numericality: {
:greater_than => 0}
validates :description, presence: true
validates :hours, presence: true,
numericality: {
:greater_than_or_equal_to => 0 }
validates :length, presence: true, numericality: {
:greater_than => 0 }
validates :vendor_id, presence: true
validates :cost, presence: true
validates :service_hours, presence:true, numericality: {
:greater_than => 0}
validates :sensor_type, presence: true
def defaults
self.status ||= "deployable"
self.hours ||= 0
self.failed ||= false
self.service_required ||= false
self.maintenance_status ||= false
self.daily_job_monitor ||=false
end
def explicit_updates
if !self.failed
self.update_columns(failure_comment: nil)
end
end
end
and When I run a command with select on it, I get an error
irb(main):002:0> Tool.select(:kind_id)
Tool Load (0.8ms) SELECT kind_id FROM "tools"
(Object doesn't support #inspect)
Is there a specific setting that is causing this?