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

feat(smart-field): add new options to support native polymorphic fields #694

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

nicolasalexandre9
Copy link
Member

field :addressable_type, type: 'String', polymorphic_key: true, is_filterable: true do
  object.addressable_type
end

field :addressable_id, type: 'String', polymorphic_key: true do
  object.addressable_type
end

Definition of Done

General

  • Write an explicit title for the Pull Request, following Conventional Commits specification
  • Test manually the implemented changes
  • Validate the code quality (indentation, syntax, style, simplicity, readability)

Security

  • Consider the security impact of the changes made

@nicolasalexandre9 nicolasalexandre9 force-pushed the feat/add-support-smartfield-for-poly branch from 562f08c to 4da464a Compare November 12, 2024 08:50
Copy link

codeclimate bot commented Nov 12, 2024

Code Climate has analyzed commit 4da464a and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (55% is the threshold).

This pull request will bring the total coverage in the repository to 51.0%.

View more on Code Climate.

@nicolasalexandre9 nicolasalexandre9 merged commit 891d07a into main Nov 12, 2024
6 checks passed
@nicolasalexandre9 nicolasalexandre9 deleted the feat/add-support-smartfield-for-poly branch November 12, 2024 08:57
forest-bot added a commit that referenced this pull request Nov 12, 2024
# [9.5.0](v9.4.3...v9.5.0) (2024-11-12)

### Features

* **smart-field:** add new options to support native polymorphic fields ([#694](#694)) ([891d07a](891d07a))
@forest-bot
Copy link
Member

🎉 This PR is included in version 9.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lostie
Copy link
Contributor

lostie commented Nov 12, 2024

I have tested these changes, but when I define the field for the polymorphic column with polymorphic_key, it still require us to provide the options like is_filterable, is_sortable in order to enable them.

A nice to have would be if those options were by default true when we mark the field with polymorphic_key: true, since those columns are usually filterable and sortable by default anyway.

@nicolasalexandre9
Copy link
Member Author

Hi @lostie, thanks for your feedback.

It sounds like a great idea, so we will be opening a PR soon to set these options to true by default in this case.
I'll let you know when the PR is open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants