Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amatsuda/kawaii_association
An ActiveRecord DSL extension that provides kawaii association syntax
https://github.com/amatsuda/kawaii_association
activerecord association rails
Last synced: about 1 month ago
JSON representation
An ActiveRecord DSL extension that provides kawaii association syntax
- Host: GitHub
- URL: https://github.com/amatsuda/kawaii_association
- Owner: amatsuda
- License: mit
- Created: 2020-02-21T12:02:06.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-21T03:42:28.000Z (about 2 years ago)
- Last Synced: 2024-12-09T07:42:01.874Z (about 2 months ago)
- Topics: activerecord, association, rails
- Language: Ruby
- Homepage:
- Size: 16.6 KB
- Stars: 22
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# KawaiiAssociation
An ActiveRecord DSL extension that provides kawaii association syntax.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'kawaii_association'
```And then execute:
$ bundle install
## Usage
This gem extends Active Record association definition methods to take a block:
```ruby
class Post < ActiveRecord::Base
has_many do
comments
endhas_one do
category dependent: :nullify
endbelongs_to do
blog touch: true
author
end
...
end
```## Contributing
Pull requests are welcome on GitHub at https://github.com/amatsuda/kawaii_association.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).