Skip to content

Commit

Permalink
APP-3014 Update to use self.id instead of self[:id] as the later has …
Browse files Browse the repository at this point in the history
…been deprecated (localytics#31)
  • Loading branch information
ACerka-Springbuk authored and zokioki committed Aug 30, 2024
1 parent 418a03f commit f73407c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/odbc_adapter/concerns/easy_identified.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ module EasyIdentified
alias_method :pre_easy_identified_save!, :save!

def save(**options, &block)
if self[:id] == :auto_generate then generate_id(true) end
if self.id == :auto_generate then generate_id(true) end
pre_easy_identified_save(**options, &block)
end

def save!(**options, &block)
if self[:id] == :auto_generate then generate_id(true) end
if self.id == :auto_generate then generate_id(true) end
pre_easy_identified_save!(**options, &block)
end

def generate_id(force_new = false)
if self[:id] == nil || force_new then self[:id] = retrieve_id end
if self.id == nil || force_new then self.id = retrieve_id end
end

private
Expand Down

0 comments on commit f73407c

Please sign in to comment.