- Use
as:
for polymorphic associations - Add tests against Rails 7.1, 7.2, 8.0 and Rails main
- Require Rails 7.1+ for
normalizes
support
- Only set ReferralCode#code if it is blank #20
- Move controller constant to lib
- Fixes HasReferrals constant lookup
- Add
Refer.referral_completed = ->(referral) { }
callback that runs when a referral is marked as completed referral.complete!
does nothing if already completed
- Add
completed
scope toRefer::Referral
- Add visit tracking #5
- Configurable referral cookie overwrites #4 Choose between the original referral code or the most recent referral code to receive the referral
- Fix referral code default generator
- Change migrations to use Rails 6.1 version for compatibility
- Add
set_referral_cookie
controller method - Add
rails g refer:install
generator to injectset_referral_cookie
- Added
dependent: :nullify
so ReferralCodes persist Referral records when deleted. - Added
dependent: :destroy
so Referrals and ReferralCodes are deleted when users are deleted. - Fixed missing
referral_codes
association on users
- Initial release