aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorVlatka Pavisic2017-01-16 15:21:11 +0100
committerVlatka Pavisic2017-01-16 15:21:11 +0100
commit307f808e2c812bccccd1c6246ca6b8583be4ef40 (patch)
tree694dc741ecef8f502097f5c79e5217f933bd727b /db
parent9e69db1f517d15ab52cd169e3a5774d9071c3630 (diff)
downloadchouette-core-307f808e2c812bccccd1c6246ca6b8583be4ef40.tar.bz2
Refs #2399 : User routes permissions
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170116140623_give_routes_permissions_to_users.rb8
-rw-r--r--db/schema.rb2
2 files changed, 9 insertions, 1 deletions
diff --git a/db/migrate/20170116140623_give_routes_permissions_to_users.rb b/db/migrate/20170116140623_give_routes_permissions_to_users.rb
new file mode 100644
index 000000000..22a08e738
--- /dev/null
+++ b/db/migrate/20170116140623_give_routes_permissions_to_users.rb
@@ -0,0 +1,8 @@
+class GiveRoutesPermissionsToUsers < ActiveRecord::Migration
+ def change
+ User.find_each do |user|
+ user.permissions =['routes.create', 'routes.edit', 'routes.destroy']
+ user.save!
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index fe0ddec32..880597573 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20170113155639) do
+ActiveRecord::Schema.define(version: 20170116140623) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"