lib/hobo/permissions.rb in hobo-0.9.102 vs lib/hobo/permissions.rb in hobo-0.9.103
- old
+ new
@@ -98,30 +98,30 @@
def has_one_with_hobo_permission_check(association_id, options = {}, &extension)
has_one_without_hobo_permission_check(association_id, options, &extension)
reflection = reflections[association_id]
if reflection.options[:dependent]==:destroy
- #overriding dynamic method created in ActiveRecord::Associations#configure_dependency_for_has_many
+ #overriding dynamic method created in ActiveRecord::Associations#configure_dependency_for_has_one
method_name = "has_one_dependent_destroy_for_#{reflection.name}".to_sym
define_method(method_name) do
association = send(reflection.name)
unless association.nil?
- association.is_a?(Hobo::Model) ? association.user_destroy(active_user) : association.destroy
+ association.is_a?(Hobo::Model) ? association.user_destroy(acting_user) : association.destroy
end
end
end
end
def belongs_to_with_hobo_permission_check(association_id, options = {}, &extension)
belongs_to_without_hobo_permission_check(association_id, options, &extension)
reflection = reflections[association_id]
if reflection.options[:dependent]==:destroy
- #overriding dynamic method created in ActiveRecord::Associations#configure_dependency_for_has_many
+ #overriding dynamic method created in ActiveRecord::Associations#configure_dependency_for_belongs_to
method_name = "belongs_to_dependent_destroy_for_#{reflection.name}".to_sym
define_method(method_name) do
association = send(reflection.name)
unless association.nil?
- association.is_a?(Hobo::Model) ? association.user_destroy(active_user) : association.destroy
+ association.is_a?(Hobo::Model) ? association.user_destroy(acting_user) : association.destroy
end
end
end
end