0.29
No commit activity in last 3 years
No release in over 3 years
Interactor Rails provides Rails support for the Interactor gem.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 4.2
 Project Readme

Interactor Rails

Gem Build Coverage Maintainability

Interactor Rails provides Rails support for the Interactor gem.

Installation

Add this line to your application's Gemfile:

gem "interactor-rails", "~> 2.0"

Interactor Rails is compatible with Ruby 2.3, 2.4, or 2.5 on Rails 4.2, 5.0, 5.1, 5.2 or 6.0.

Usage

Interactor Rails ensures that app/interactors is included in your autoload paths, and provides generators for your convenience.

rails generate interactor authenticate_user

adds to app/interactors/authenticate_user.rb:

class AuthenticateUser
  include Interactor

  def call
    # TODO
  end
end

There is also a generator for organizers.

rails generate interactor:organizer place_order charge_card send_thank_you fulfill_order

adds to app/interactors/place_order.rb:

class PlaceOrder
  include Interactor::Organizer

  organize ChargeCard, SendThankYou, FulfillOrder
end

Contributions

Interactor Rails is open source and contributions from the community are encouraged! No contribution is too small.

See Interactor Rails' contribution guidelines for more information.

Thank You!

A very special thank you to Attila Domokos for his fantastic work on LightService. Interactor is inspired heavily by the concepts put to code by Attila.