summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-02-24 03:24:54 -0500
committerPeter Kozak <spag@golwen.net>2013-02-24 03:24:54 -0500
commitc77dc2aaa3c5299b17c9b6d022d1e316c9d61a59 (patch)
treeffcf13a704d6544e9bcf0b5549f8ec51de5b72a8
parent757fbb9de88c1b6d8ec1eff6519bd057c74892a5 (diff)
adapt routes to user_groups
-rw-r--r--db/migrate/20130224081700_groups_to_user_groups_in_routes.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20130224081700_groups_to_user_groups_in_routes.rb b/db/migrate/20130224081700_groups_to_user_groups_in_routes.rb
new file mode 100644
index 0000000..5e03cfa
--- /dev/null
+++ b/db/migrate/20130224081700_groups_to_user_groups_in_routes.rb
@@ -0,0 +1,19 @@
+class GroupsToUserGroupsInRoutes < ActiveRecord::Migration
+ def up
+ RouteElement.where(:var_in => 'val:auth_account.owner.groups').each do |route_element|
+ route_element.update_attributes(:var_in => 'val:auth_account.owner.user_groups')
+ end
+ RouteElement.where(:var_in => 'val:account.owner.groups').each do |route_element|
+ route_element.update_attributes(:var_in => 'val:account.owner.user_groups')
+ end
+ end
+
+ def down
+ RouteElement.where(:var_in => 'val:auth_account.owner.user_groups').each do |route_element|
+ route_element.update_attributes(:var_in => 'val:auth_account.owner.groups')
+ end
+ RouteElement.where(:var_in => 'val:account.owner.user_groups').each do |route_element|
+ route_element.update_attributes(:var_in => 'val:account.owner.groups')
+ end
+ end
+end