Skip to content

Commit 776a2a1

Browse files
authored
Fix method redefined warning for support_email (#1214)
`mattr_accessor :support_email` creates a `support_email=` writer, but we immediately redefine it to add Mail::Address casting. This triggers Ruby's "method redefined" warning when running with warnings enabled. Use `mattr_reader` instead since we define the writer manually.
1 parent c0ab652 commit 776a2a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/pay.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module Billable
3838
mattr_accessor :business_address
3939
mattr_accessor :business_name
4040
mattr_accessor :business_logo
41-
mattr_accessor :support_email
41+
mattr_reader :support_email
4242

4343
def self.support_email=(value)
4444
@@support_email = value.is_a?(::Mail::Address) ? value : ::Mail::Address.new(value)

0 commit comments

Comments
 (0)