Created
September 8, 2017 10:18
-
-
Save morgler/eb2199c453f471cf883d4d8bfd6ff504 to your computer and use it in GitHub Desktop.
This is the correct version of how to override an attr_accessor in a module in Rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Concern to be included into an ActiveModel | |
module Attendable | |
extend ActiveSupport::Concern | |
included do | |
attr_reader :user_fees | |
end | |
def user_fees= new_user_fees | |
… | |
@user_fees = new_user_fees | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment