Skip to content

There is a bug? doc_methods_controller line 38 contains an error field id instead of user_id #1598

Open
@carlosdanielpohlod

Description

@carlosdanielpohlod

An field error who makes the SELECT don´t be able to find the dabase data

Expected Behavior

The wrong field as a param make an SELECT error

Possible Solution

fix id to user_id

Context

The issue appeared to me while i´m make automated tests for this class

method:
doc_methods_controller (class)

`def click_source_redirect

doc        = DocMethod.find(params[:id])

sub        = RepoSubscription.find_by!(id: params[:user_id], repo: doc.repo)

assignment = DocAssignment.find_by!(doc_method_id: doc.id, repo_subscription_id: sub.id)

`
The RepoSusbcription are find by the id, but using user_id instead of the RepoSubscription id

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions