module Kagetsu
Constants
- VERSION
Public Instance Methods
create_or_update(key:, update_attributes:)
click to toggle source
# File lib/kagetsu.rb, line 5 def create_or_update(key:, update_attributes:) create_or_update!(key: key, update_attributes: update_attributes) rescue => ex false end
create_or_update!(key:, update_attributes:)
click to toggle source
# File lib/kagetsu.rb, line 11 def create_or_update!(key:, update_attributes:) object = find_or_initialize_by(key) object.update(update_attributes) end