Sha256: f15a3da596e85c5c3e2fba28bc99845ffcbb52a9f4da32c22d8928380f1f3bad
Contents?: true
Size: 389 Bytes
Versions: 1
Compression:
Stored size: 389 Bytes
Contents
require 'kagetsu/version' require 'active_record' module Kagetsu def create_or_update(key:, update_attributes:) create_or_update!(key: key, update_attributes: update_attributes) rescue => ex false end def create_or_update!(key:, update_attributes:) object = find_or_initialize_by(key) object.update(update_attributes) end end ActiveRecord::Base.extend Kagetsu
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
kagetsu-1.0.0 | lib/kagetsu.rb |