Skip to content

Instantly share code, notes, and snippets.

@morgler
Last active September 8, 2017 10:17
Show Gist options
  • Save morgler/507c0486350d507bf243d475c006346c to your computer and use it in GitHub Desktop.
Save morgler/507c0486350d507bf243d475c006346c to your computer and use it in GitHub Desktop.
This is WRONG code to show a pitfall with attr_accessor
# Concern to be included into an ActiveModel
module Attendable
extend ActiveSupport::Concern
 
included do
  attr_accessor :user_fees
  end
 
def user_fees= new_user_fees
write_attribute(: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