lib/merit/model_additions.rb in merit-3.0.1 vs lib/merit/model_additions.rb in merit-3.0.2
- old
+ new
@@ -5,10 +5,10 @@
def has_merit(options = {})
# MeritableModel#sash_id is more stable than Sash#meritable_model_id
# That's why MeritableModel belongs_to Sash. Can't use
# dependent: destroy as it may raise FK constraint exceptions. See:
# https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1079-belongs_to-dependent-destroy-should-destroy-self-before-assocation
- belongs_to :sash, class_name: 'Merit::Sash', inverse_of: nil
+ belongs_to :sash, class_name: 'Merit::Sash', inverse_of: nil, optional: true
attr_accessible :sash if show_attr_accessible?
send :"_merit_#{Merit.orm}_specific_config"
_merit_delegate_methods_to_sash
_merit_define_badge_related_entries_method