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

Update has_many.rb #2274

Merged
merged 7 commits into from
Nov 15, 2022
Merged

Update has_many.rb #2274

merged 7 commits into from
Nov 15, 2022

Conversation

jubilee2
Copy link
Contributor

@jubilee2 jubilee2 commented Oct 1, 2022

disable paginate for has_many field

solve #2271

disable paginate for has_many
@tancrede
Copy link

tancrede commented Oct 4, 2022

Hi jubilee2,

Thanks for the proposal. If my understanding of your code is correct, this change would allow something like this ?

ATTRIBUTE_TYPES = {
    names: Field::HasMany.with_options(paginate: false),
  }.freeze

@jubilee2
Copy link
Contributor Author

jubilee2 commented Oct 5, 2022

Yes, It is correct!

@pablobm
Copy link
Collaborator

pablobm commented Oct 6, 2022

How about making it work with limit: false instead?

@tancrede
Copy link

tancrede commented Oct 6, 2022

that would be a little more natural

@jubilee2
Copy link
Contributor Author

jubilee2 commented Oct 6, 2022

      def paginate?
        limit != false 
      end

@pablobm
Copy link
Collaborator

pablobm commented Oct 13, 2022

@jubilee2 - I think that's right. What do you think? Would you be up for modifying your PR?

@jubilee2
Copy link
Contributor Author

@pablobm

can you help me update the document? Thanks!

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.

Sorry for the long delay. Let's see if we can get this merged!

lib/administrate/field/has_many.rb Outdated Show resolved Hide resolved
@@ -44,6 +44,10 @@ def selected_options
def limit
options.fetch(:limit, DEFAULT_LIMIT)
end

Copy link
Collaborator

Choose a reason for hiding this comment

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

Remember to remove this trailing space 🙂

docs/customizing_dashboards.md Outdated Show resolved Hide resolved
jubilee2 and others added 3 commits November 4, 2022 08:51
Co-authored-by: Pablo Brasero <36066+pablobm@users.noreply.github.com>
Co-authored-by: Pablo Brasero <36066+pablobm@users.noreply.github.com>
@jubilee2
Copy link
Contributor Author

Sorry for the long delay. Let's see if we can get this merged!

resolved

@pablobm pablobm merged commit e0814ef into thoughtbot:main Nov 15, 2022
@tancrede
Copy link

Thank you @ALL for this evolution.

@pablobm
Copy link
Collaborator

pablobm commented Dec 5, 2022

By the way, a bug was introduced here. It should have surfaced in CI but somehow it didn't 🤔 Oh well.

I have created #2289 to fix this. Currently waiting for a fellow maintainer to review.

@jubilee2
Copy link
Contributor Author

jubilee2 commented Dec 6, 2022

not sure the CI not trigger on PR... take look into nonzero

@jubilee2
Copy link
Contributor Author

jubilee2 commented Dec 8, 2022

#2296 should fix issue

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.

3 participants