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

How can I define a param group without duplicating what is defined in ActiveRecord model? #907

Open
epugh opened this issue Jan 10, 2024 · 1 comment
Labels

Comments

@epugh
Copy link
Contributor

epugh commented Jan 10, 2024

My code has a lot of:

      def_param_group :book do
        param :name, String
        param :show_rank, [ true, false ]
        param :support_implicit_judgements, [ true, false ]
        param :owner_id, Integer
        param :scorer_id, Integer
        param :selection_strategy_id, Integer
      end

How can I define a book using my Rails ActiveRecord book.rb directly instead of having to create all this?

@PanosCodes
Copy link
Contributor

Maybe you can use something like describe_own_properties to avoid duplication

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

No branches or pull requests

3 participants