Skip to content

amatsuda/kawaii_association

Repository files navigation

KawaiiAssociation

An ActiveRecord DSL extension that provides kawaii association syntax.

Installation

Add this line to your application's Gemfile:

gem 'kawaii_association'

And then execute:

$ bundle install

Usage

This gem extends Active Record association definition methods to take a block:

class Post < ActiveRecord::Base
  has_many do
    comments
  end

  has_one do
    category dependent: :nullify
  end

  belongs_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.

About

An ActiveRecord DSL extension that provides kawaii association syntax

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published