Query with select and find in Rails

Asked

Viewed 113 times

0

Hello, I wanted to make a find with select of only a few fields in Rails, but it is giving error, however, if I do with Where it works normally, does anyone know if it is possible to use select with find? Ex:

@organization = Organization.find(actual_organization.id).select(:required_project_type, :required_folder_type)

1 answer

1


Do it this way:

@organization = Organization.find(actual_organization.id, :select => [:required_project_type, :required_folder_type])

Browser other questions tagged

You are not signed in. Login or sign up in order to post.