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

make permitted_attributes support action #2356

Merged
merged 6 commits into from
Apr 19, 2023

Conversation

jubilee2
Copy link
Contributor

@jubilee2 jubilee2 commented Apr 17, 2023

fix #2352 and #2066

@jubilee2 jubilee2 force-pushed the permitted_attributes-update branch from a4a3b41 to ea76c97 Compare April 17, 2023 01:06
@jubilee2 jubilee2 force-pushed the permitted_attributes-update branch from 5b04caf to 36fb3ab Compare April 17, 2023 01:36
@jubilee2 jubilee2 force-pushed the permitted_attributes-update branch from a913637 to 0034879 Compare April 17, 2023 01:56
Copy link
Collaborator

@pablobm pablobm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you! I have left one comment and I think this should be good to merge soon 👍

lib/administrate/base_dashboard.rb Outdated Show resolved Hide resolved
Copy link
Collaborator

@pablobm pablobm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one tiny thing left!

Comment on lines 69 to 73

it "assigns the action name as a string" do
get :index
expect(controller.action_name).to be_a(String)
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also remove this, please? This is standard Rails behaviour and unrelated to this feature, so it doesn't need to be tested. Sorry I missed this yesterday.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want make sure action name is string not symbo, anyway I can remove it

      action =
        case action
        when "update" then "edit"
        when "create" then "new"
        else action
        end

@pablobm pablobm merged commit fd61e4d into thoughtbot:main Apr 19, 2023
@pablobm
Copy link
Collaborator

pablobm commented Apr 19, 2023

Thank you again!

@jubilee2 jubilee2 deleted the permitted_attributes-update branch April 19, 2023 14:49
littleforest added a commit to ApprenticeshipStandardsDotOrg/ApprenticeshipStandardsDotOrg that referenced this pull request Nov 30, 2023
* Add GenericRecord field type
There was no way to display the StandardsImport
associated with a SourceFile, since there
wasn't a built-in association between
the objects. This adds a new GenericRecord
administrate field that display a link
to the record.

* Fixed editing of StandardsImport
The StandardsImport uses custom
permitted_params but the latest
Administrate release had updated
that method to take a parameter
thoughtbot/administrate#2356
littleforest added a commit to ApprenticeshipStandardsDotOrg/ApprenticeshipStandardsDotOrg that referenced this pull request Nov 30, 2023
* Add GenericRecord field type
There was no way to display the StandardsImport
associated with a SourceFile, since there
wasn't a built-in association between
the objects. This adds a new GenericRecord
administrate field that display a link
to the record.

* Fixed editing of StandardsImport
The StandardsImport uses custom
permitted_params but the latest
Administrate release had updated
that method to take a parameter
thoughtbot/administrate#2356
littleforest added a commit to ApprenticeshipStandardsDotOrg/ApprenticeshipStandardsDotOrg that referenced this pull request Nov 30, 2023
* Add GenericRecord field type
There was no way to display the StandardsImport
associated with a SourceFile, since there
wasn't a built-in association between
the objects. This adds a new GenericRecord
administrate field that display a link
to the record.

* Fixed editing of StandardsImport
The StandardsImport uses custom
permitted_params but the latest
Administrate release had updated
that method to take a parameter
thoughtbot/administrate#2356
littleforest added a commit to ApprenticeshipStandardsDotOrg/ApprenticeshipStandardsDotOrg that referenced this pull request Nov 30, 2023
* Add GenericRecord field type
There was no way to display the StandardsImport
associated with a SourceFile, since there
wasn't a built-in association between
the objects. This adds a new GenericRecord
administrate field that display a link
to the record.

* Fixed editing of StandardsImport
The StandardsImport uses custom
permitted_params but the latest
Administrate release had updated
that method to take a parameter
thoughtbot/administrate#2356
littleforest added a commit to ApprenticeshipStandardsDotOrg/ApprenticeshipStandardsDotOrg that referenced this pull request Dec 1, 2023
* Add GenericRecord field type
There was no way to display the StandardsImport
associated with a SourceFile, since there
wasn't a built-in association between
the objects. This adds a new GenericRecord
administrate field that display a link
to the record.

* Fixed editing of StandardsImport
The StandardsImport uses custom
permitted_params but the latest
Administrate release had updated
that method to take a parameter
thoughtbot/administrate#2356
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

the permitted_attributes may need pass current action
2 participants