rename lambda references to use shorthand syntax
This commit is contained in:
@@ -3,7 +3,7 @@ class IpBan < ApplicationRecord
|
||||
belongs_to_creator
|
||||
validates_presence_of :reason, :creator, :ip_addr
|
||||
validates_format_of :ip_addr, :with => IP_ADDR_REGEX
|
||||
validates_uniqueness_of :ip_addr, :if => lambda {|rec| rec.ip_addr =~ IP_ADDR_REGEX}
|
||||
validates_uniqueness_of :ip_addr, :if => ->(rec) {rec.ip_addr =~ IP_ADDR_REGEX}
|
||||
after_create do |rec|
|
||||
ModAction.log("#{CurrentUser.name} created ip ban for #{rec.ip_addr}",:ip_ban_create)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user