Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute arguments for context generators #97

Closed
aaronmallen opened this issue Jan 6, 2020 · 0 comments · Fixed by #105
Closed

Attribute arguments for context generators #97

aaronmallen opened this issue Jan 6, 2020 · 0 comments · Fixed by #105
Labels
feature New feature or request
Milestone

Comments

@aaronmallen
Copy link
Owner

Elevator pitch, describe and sell us your feature request

As a developer,
I want to be able to give the Context generator attribute arguments
so that attributes are automatically defined on my context class when it is generated.

Is your feature request related to a problem

It would be nice to be able to generate an interactor with a given set of attributes and have the generator automatically populate those attributes:

rails generate interactor MyInteractor first_name last_name
# app/interactors/my_interactor_context.rb
class MyInteractorContext < ApplicationContext
  attributes :first_name, :last_name
end

# app/interactors/my_interactor.rb
class MyInteractor
  def perform
    # TODO implement MyInteractor call
  end
  
  def rollback
    # TODO implement MyInteractor rollback
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant