Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
catmando authored and sfcgeorge committed Mar 6, 2018
1 parent 03ff575 commit a52175b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/reactive_record/active_record/instance_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module ActiveRecord
module InstanceMethods

def inspect
"<#{model_name}:#{ReactiveRecord::Operations::Base::FORMAT % backing_record.object_id} "\
"<#{model_name}:#{ReactiveRecord::Operations::Base::FORMAT % to_key} "\
"(#{ReactiveRecord::Operations::Base::FORMAT % object_id}) "\
"#{backing_record.inspection_details} >"
end
Expand Down Expand Up @@ -173,6 +173,10 @@ def errors
@backing_record.errors
end

def to_key
@backing_record.object_id
end

def update_attribute(attr, value, &block)
send("#{attr}=", value)
save(validate: false, &block)
Expand Down

0 comments on commit a52175b

Please sign in to comment.