Skip to content

Commit

Permalink
Fixed #4 Reset the default query if project is not the current project
Browse files Browse the repository at this point in the history
  • Loading branch information
hidakatsuya committed Jul 31, 2014
1 parent 42ba90e commit 7595c9b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/models/projects_default_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ def query
default_query = super
return unless default_query

if !new_record? && !default_query.public_visibility?
update_attribute :query_id, nil
unless new_record?
unless default_query.public_visibility? &&
default_query.project == project
update_attribute :query_id, nil
end
end
default_query
end
Expand Down

0 comments on commit 7595c9b

Please sign in to comment.