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

ApplicationContract is not defined. Rails 7.1.2 #62

Open
alexeevit opened this issue Nov 21, 2023 · 2 comments
Open

ApplicationContract is not defined. Rails 7.1.2 #62

alexeevit opened this issue Nov 21, 2023 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@alexeevit
Copy link

alexeevit commented Nov 21, 2023

Describe the bug

Hey, I ran into an issue when with a clean setup I don't have defined ApplicationContract.
This is my first time using dry-rails, maybe I'm doing something wrong? Demo app link is below.

UPD:

  • checked with latest version from github
  • checked with cherry-picking the feature
    result is the same

To Reproduce

$ rails new myapp --minimal
$ bundle add dry-rails
$ bin/rails c
irb(main):001> ApplicationContract
(irb):1:in `<main>': uninitialized constant ApplicationContract (NameError)

Demo app

My environment

  • Ruby version: 3.1.2
  • Rails version: 7.1.2
  • OS: Debian bookworm in docker & macos 13.4.1
  • dry-rails 0.7.0
  • dry-system 1.0.1
  • dry-schema 1.13.3
  • dry-validation 1.10.0
@alexeevit alexeevit added bug Something isn't working help wanted Extra attention is needed labels Nov 21, 2023
@alexeevit alexeevit changed the title ApplicationContract is not defined ApplicationContract is not defined. Rails 7.1.2 Nov 21, 2023
@iwdt
Copy link

iwdt commented Feb 3, 2024

@alexeevit to solve this problem, you can create a file app/contracts/application_contract.rb with:

# frozen_string_literal: true

# Base class for contracts
#
# @abstract
class ApplicationContract < Dry::Rails::Features::ApplicationContract
end

@alexeevit
Copy link
Author

@alexeevit to solve this problem, you can create a file app/contracts/application_contract.rb with:

# frozen_string_literal: true

# Base class for contracts
#
# @abstract
class ApplicationContract < Dry::Rails::Features::ApplicationContract
end

Indeed, I can. It's just a good thing to report a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants