diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-01-05 20:20:12 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-01-25 14:43:15 +0300 |
commit | 52c5f9c97f20529b608f5b47a7c361383ccadb54 (patch) | |
tree | a0eef9b8f387a9cc7c401b68d44ad4ee8183774e /app/models/namespace.rb | |
parent | 51c4b20c48f29fe34fd1306f7a115f645eb9fb71 (diff) |
Add User#nested_groups and User#nested_projects methods
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index d3a4ddbb3bf..eb970dddd91 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -194,7 +194,7 @@ class Namespace < ActiveRecord::Base paths << path end - self.class.joins(:route).where('routes.path IN (?)', paths).order_id_asc + self.class.joins(:route).where('routes.path IN (?)', paths).reorder('routes.path ASC') else self.class.none end @@ -202,7 +202,7 @@ class Namespace < ActiveRecord::Base # Scopes the model on direct and indirect children of the record def descendants - self.class.joins(:route).where('routes.path LIKE ?', "#{route.path}/%").order_id_asc + self.class.joins(:route).where('routes.path LIKE ?', "#{route.path}/%").reorder('routes.path ASC') end private |