Skip to content

Commit

Permalink
Fixed removal of conditional eager loading in #446
Browse files Browse the repository at this point in the history
Added inverse_of association to conditions.
  • Loading branch information
dariusf committed Jul 28, 2015
1 parent 28def27 commit 29078b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/extensions/conditional/active_record/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module ClassMethods
# Declare this function in the conditional model that requires conditions.
def acts_as_conditional
has_many :conditions, -> { includes :actable },
class_name: Course::Condition.name, as: :conditional, dependent: :destroy
class_name: Course::Condition.name, as: :conditional, dependent: :destroy,
inverse_of: :conditional

include ConditionalInstanceMethods
end
Expand Down

0 comments on commit 29078b1

Please sign in to comment.