Sha256: d1deae2fefbf2f296aff1af104f1df4b4c468cea05f4a682fe0ff71a87908eb4

Contents?: true

Size: 540 Bytes

Versions: 1

Compression:

Stored size: 540 Bytes

Contents

# 花月(Kagetsu) [![CircleCI](https://circleci.com/gh/taki/kagetsu.svg?style=svg)](https://circleci.com/gh/taki/kagetsu)

kagetsu is a library for create or update method on ActiveRecord.

## Requirement

- Rails 5.2 or upper

## Usage

```ruby
User.create!(name: 'kotoko', email: 'old@example.com')
user = User.create_or_update(key: { name: 'kotoko' }, update_attributes: { email: 'new@example.com' })

user.email #=> new@example.com
```

## Available Methods

- ActiveRecord::Base#create_or_update
- ActiveRecord::Base#create_or_update!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kagetsu-1.0.0 README.md