Skip to content

Support method symbols in max_audits - #607

Open
gathuku wants to merge 2 commits into
collectiveidea:mainfrom
gathuku:max-audits-symbol
Open

gathuku wants to merge 2 commits into
collectiveidea:mainfrom
gathuku:max-audits-symbol

Conversation

@gathuku

@gathuku gathuku commented Dec 5, 2021

Copy link
Copy Markdown

Allow passing a method symbol to max_audits for dynamic maximum audits

Example

class User < ApplicationRecord
  audited max_audits: :max 
  
  private 
  
  def max
    self.maximum_audits || 10
  end
end

Comment thread lib/audited/auditor.rb Outdated
Comment thread lib/audited/auditor.rb Outdated
@gathuku

gathuku commented Dec 5, 2021

Copy link
Copy Markdown
Author

@fractaledmind Thank you for the good review

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.

2 participants