Skip to content

Instantly share code, notes, and snippets.

@jasdeepsingh
Created August 19, 2021 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasdeepsingh/fcc0a2c4bcc6a4174d8fb6540eed44d8 to your computer and use it in GitHub Desktop.
Save jasdeepsingh/fcc0a2c4bcc6a4174d8fb6540eed44d8 to your computer and use it in GitHub Desktop.
Equality Operator Override for Embedded Associations
# [5] pry(main)> r.exclusion_rules
# => [#<ExclusionRule _id: 611e94fa7d8fbc102109e5cd, type: "wday", value: [1], exclusionary: true>]
# [6] pry(main)> r.exclusion_rules = [ExclusionRule.new(id: '611e94fa7d8fbc102109e5cd', type: 'wday', value: [2])]
# => [#<ExclusionRule _id: 611e94fa7d8fbc102109e5cd, type: "wday", value: [2], exclusionary: true>]
# [7] pry(main)> r.save
# => true
# [8] pry(main)> r.exclusion_rules
# => [#<ExclusionRule _id: 611e94fa7d8fbc102109e5cd, type: "wday", value: [1], exclusionary: true>]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment