lib/social_stream/models/subject.rb in social_stream-0.4.2 vs lib/social_stream/models/subject.rb in social_stream-0.4.3
- old
+ new
@@ -61,13 +61,17 @@
def to_param
slug
end
- # Delegate missing methods to {Actor}, if they are defined there
+ # Delegate missing methods to {Actor}, if they exist there
def method_missing(method, *args, &block)
super
rescue NameError => subject_error
+ # These methods must be raised to avoid loops (the :actor association calls here again)
+ exceptions = [ :_actor_id ]
+ raise subject_error if exceptions.include?(method)
+
actor!.__send__ method, *args, &block
end
# {Actor} handles some methods
def respond_to? *args