mks_auth 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36ed62a3674c287c721d3116362ce195f3e42f1b8c11245be863024d27acd132
4
- data.tar.gz: 9dd66148f43c6d6e274516fe80fa52cc4a10238b52f9e5ae7675fd25d32df20d
3
+ metadata.gz: c907733e63eef4854c4db8704f3daa94c7a0b1b480f269ff637a3284c0a28cb8
4
+ data.tar.gz: 074df8a8fdbe2404cb41502eeda796c1e5b5b1223e4560d7cb9951abfbb20657
5
5
  SHA512:
6
- metadata.gz: 338958518df7bd9a52df411c8f73cfa9271702e79f962ece8bf7bf21d3969abc2f6a02d8e06dcb853616999a1db88d7a31ef1f3409d1f3c0ab087cbb25aa80a7
7
- data.tar.gz: b8a1ee05f2e6290aa745916b9e8bfe2ebee3f4cf44a601e328de99283d9bf9bbd03ba7099cf8da6776bfa9a428bd5407f7782aadf85044a7fff5fa817a6d49e8
6
+ metadata.gz: 5aedd858609f529f3e6252b633ed8bc725147f06c815a727240af9073040aa30a11aecfa2536438cdc3213b99fd5a0499b6e01007afc0ad30aa2e15e90e5c1bc
7
+ data.tar.gz: 79f22a94f71e8368ed127c7ef6c99b0b33762f29bce47e287213c791c7fc31df9c54b3aa29f3022cf671142975dad93f0e9272729e27756b95f8bf58b9eab99e
@@ -6,15 +6,12 @@ module Mks
6
6
 
7
7
  def index
8
8
  @users = ApplicationModule.find_by(code: app_code).users
9
- response = { success: true, data: @users }
10
- render json: response
9
+ render json: @users
11
10
  end
12
11
 
13
12
  def roles
14
13
  user = User.find(params[:id])
15
- data = user.roles
16
- response = { success: true, data: data }
17
- render json: response
14
+ render json: user.roles
18
15
  end
19
16
 
20
17
  # A method to fetch all roles, with roles of
@@ -1,5 +1,5 @@
1
1
  module Mks
2
2
  module Auth
3
- VERSION = '1.0.5'.freeze
3
+ VERSION = '1.0.6'.freeze
4
4
  end
5
5
  end
@@ -16,7 +16,7 @@ module Mks
16
16
  u.roles << roles
17
17
  get :roles, params: { id: u.id }
18
18
  result = JSON(response.body)
19
- expect(result['data'].count).to eq 2
19
+ expect(result.count).to eq 2
20
20
  end
21
21
  end
22
22
 
@@ -13750,3 +13750,175 @@ FOREIGN KEY ("user_id")
13750
13750
   (0.7ms) BEGIN
13751
13751
  ActiveRecord::InternalMetadata Update (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-07-27 06:46:26.665522"], ["key", "environment"]]
13752
13752
   (1.3ms) COMMIT
13753
+  (5.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
13754
+  (1.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
13755
+  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
13756
+  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
13757
+  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
13758
+  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
13759
+  (114.1ms) DROP DATABASE IF EXISTS "construction_test"
13760
+  (352.1ms) CREATE DATABASE "construction_test" ENCODING = 'utf8'
13761
+ SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
13762
+  (1.1ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE
13763
+  (20.9ms) CREATE TABLE "mks_auth_application_modules" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
13764
+  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE
13765
+  (13.1ms) CREATE TABLE "mks_auth_menus" ("id" bigserial primary key, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
13766
+  (6.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")
13767
+  (5.5ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")
13768
+  (1.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE
13769
+  (7.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" bigserial primary key, "menu_id" bigint, "user_role_id" bigint)
13770
+  (3.7ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")
13771
+  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE
13772
+  (10.4ms) CREATE TABLE "mks_auth_user_roles" ("id" bigserial primary key, "name" character varying NOT NULL, "application_module_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
13773
+  (4.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")
13774
+  (2.0ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE
13775
+  (9.1ms) CREATE TABLE "mks_auth_users" ("id" bigserial primary key, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
13776
+  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE
13777
+  (2.4ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)
13778
+  (4.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")
13779
+  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE
13780
+  (2.1ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" bigint, "user_role_id" bigint)
13781
+  (6.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")
13782
+  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5"
13783
+ FOREIGN KEY ("application_module_id")
13784
+ REFERENCES "mks_auth_application_modules" ("id")
13785
+ 
13786
+  (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc"
13787
+ FOREIGN KEY ("parent_id")
13788
+ REFERENCES "mks_auth_menus" ("id")
13789
+ 
13790
+  (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36"
13791
+ FOREIGN KEY ("menu_id")
13792
+ REFERENCES "mks_auth_menus" ("id")
13793
+ 
13794
+  (3.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0"
13795
+ FOREIGN KEY ("user_role_id")
13796
+ REFERENCES "mks_auth_user_roles" ("id")
13797
+ 
13798
+  (2.7ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2"
13799
+ FOREIGN KEY ("application_module_id")
13800
+ REFERENCES "mks_auth_application_modules" ("id")
13801
+ 
13802
+  (2.8ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c"
13803
+ FOREIGN KEY ("application_module_id")
13804
+ REFERENCES "mks_auth_application_modules" ("id")
13805
+ 
13806
+  (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a"
13807
+ FOREIGN KEY ("user_id")
13808
+ REFERENCES "mks_auth_users" ("id")
13809
+ 
13810
+  (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8"
13811
+ FOREIGN KEY ("user_role_id")
13812
+ REFERENCES "mks_auth_user_roles" ("id")
13813
+ 
13814
+  (4.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa"
13815
+ FOREIGN KEY ("user_id")
13816
+ REFERENCES "mks_auth_users" ("id")
13817
+ 
13818
+  (7.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
13819
+  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
13820
+  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)
13821
+  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES
13822
+ (20161029065810),
13823
+ (20161029065959),
13824
+ (20161029070807),
13825
+ (20161029071047),
13826
+ (20161029072256),
13827
+ (20161029074023);
13828
+
13829
+ 
13830
+  (7.8ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
13831
+ ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
13832
+  (0.9ms) BEGIN
13833
+ ActiveRecord::InternalMetadata Create (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-07-27 07:26:35.190384"], ["updated_at", "2018-07-27 07:26:35.190384"]]
13834
+  (1.4ms) COMMIT
13835
+ ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
13836
+  (0.8ms) BEGIN
13837
+ ActiveRecord::InternalMetadata Update (1.1ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-07-27 07:26:35.199604"], ["key", "environment"]]
13838
+  (1.4ms) COMMIT
13839
+  (2.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
13840
+  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
13841
+  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
13842
+  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
13843
+  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
13844
+  (1.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
13845
+  (118.8ms) DROP DATABASE IF EXISTS "construction_test"
13846
+  (386.9ms) CREATE DATABASE "construction_test" ENCODING = 'utf8'
13847
+ SQL (1.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
13848
+  (1.1ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE
13849
+  (11.7ms) CREATE TABLE "mks_auth_application_modules" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
13850
+  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE
13851
+  (9.2ms) CREATE TABLE "mks_auth_menus" ("id" bigserial primary key, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
13852
+  (4.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")
13853
+  (3.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")
13854
+  (1.1ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE
13855
+  (4.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" bigserial primary key, "menu_id" bigint, "user_role_id" bigint)
13856
+  (3.9ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")
13857
+  (1.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE
13858
+  (8.7ms) CREATE TABLE "mks_auth_user_roles" ("id" bigserial primary key, "name" character varying NOT NULL, "application_module_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
13859
+  (4.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")
13860
+  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE
13861
+  (7.3ms) CREATE TABLE "mks_auth_users" ("id" bigserial primary key, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
13862
+  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE
13863
+  (2.0ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)
13864
+  (3.9ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")
13865
+  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE
13866
+  (2.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" bigint, "user_role_id" bigint)
13867
+  (3.7ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")
13868
+  (3.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5"
13869
+ FOREIGN KEY ("application_module_id")
13870
+ REFERENCES "mks_auth_application_modules" ("id")
13871
+ 
13872
+  (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc"
13873
+ FOREIGN KEY ("parent_id")
13874
+ REFERENCES "mks_auth_menus" ("id")
13875
+ 
13876
+  (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36"
13877
+ FOREIGN KEY ("menu_id")
13878
+ REFERENCES "mks_auth_menus" ("id")
13879
+ 
13880
+  (4.0ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0"
13881
+ FOREIGN KEY ("user_role_id")
13882
+ REFERENCES "mks_auth_user_roles" ("id")
13883
+ 
13884
+  (3.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2"
13885
+ FOREIGN KEY ("application_module_id")
13886
+ REFERENCES "mks_auth_application_modules" ("id")
13887
+ 
13888
+  (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c"
13889
+ FOREIGN KEY ("application_module_id")
13890
+ REFERENCES "mks_auth_application_modules" ("id")
13891
+ 
13892
+  (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a"
13893
+ FOREIGN KEY ("user_id")
13894
+ REFERENCES "mks_auth_users" ("id")
13895
+ 
13896
+  (3.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8"
13897
+ FOREIGN KEY ("user_role_id")
13898
+ REFERENCES "mks_auth_user_roles" ("id")
13899
+ 
13900
+  (2.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa"
13901
+ FOREIGN KEY ("user_id")
13902
+ REFERENCES "mks_auth_users" ("id")
13903
+ 
13904
+  (7.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
13905
+  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
13906
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)
13907
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES
13908
+ (20161029065810),
13909
+ (20161029065959),
13910
+ (20161029070807),
13911
+ (20161029071047),
13912
+ (20161029072256),
13913
+ (20161029074023);
13914
+
13915
+ 
13916
+  (6.5ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
13917
+ ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
13918
+  (0.7ms) BEGIN
13919
+ ActiveRecord::InternalMetadata Create (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-07-27 07:27:22.444862"], ["updated_at", "2018-07-27 07:27:22.444862"]]
13920
+  (1.7ms) COMMIT
13921
+ ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
13922
+  (0.5ms) BEGIN
13923
+ ActiveRecord::InternalMetadata Update (1.1ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-07-27 07:27:22.453500"], ["key", "environment"]]
13924
+  (1.4ms) COMMIT