Skip to content

Commit

Permalink
fix for singular resources
Browse files Browse the repository at this point in the history
resource :user
resolve('User') { [:user] }
  • Loading branch information
ermolaev committed Aug 13, 2024
1 parent c6e98a5 commit 644c641
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_dry_form/form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Form < BaseForm
cattr_accessor :contract_klass, instance_accessor: false, default: ::ActiveDryForm::BaseContract

def self.fields(namespace, &block)
const_set :NAMESPACE, ActiveModel::Name.new(nil, nil, namespace.to_s)
const_set :NAMESPACE, ActiveModel::Name.new(nil, nil, namespace.name.capitalize)
const_set :CURRENT_CONTRACT, Class.new(contract_klass, &block).new
const_set :FIELDS_INFO, self::CURRENT_CONTRACT.schema.json_schema(loose: true)

Expand Down

0 comments on commit 644c641

Please sign in to comment.