simply_auth 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 648f0d37f903650050ec9dca44717698114f89cb
4
- data.tar.gz: 0f6d3de65839ae7ba9a6c5557356aac357af8247
2
+ SHA256:
3
+ metadata.gz: 0001e3ce2a6ca0f68b35de04fde16ccf62818250f061efedaf6139b4037b7839
4
+ data.tar.gz: 9126aeca9a3e00085c1991d0bdf80017cb7098b950bc25139b391fd7881443c3
5
5
  SHA512:
6
- metadata.gz: a78d1e67a4ad52d29dd741baf8caf1f5f378ac982dba3305582fe395506c04bda97c426ff43abe7cca8f99cd7a059b4acc2186ba30863a0c4696994a7985f3b9
7
- data.tar.gz: 4a778896ed7d868ea63687bbfe11d2ffa2eaaee8f91b633c59622f63b6799826e57b5bcd77dfa974d3206b43a5ddc02b84c3e1d084620f830e8103e685528f9d
6
+ metadata.gz: d9b60106600ae9cd02ff8d8d265d8b4bca505eba968218ded87244f7033b2636a5938d3abb30e4e2cad232acd84ebe41a79ae16a101e08342f4d7e1355bcad10
7
+ data.tar.gz: 437797106a7e8ab995a3ca3127f9332885529702c1a12397de0c4ceedc3b7ef1ae831a325029b31c347310a155a3bcfefe5cb1ce067ad6098dc5bab3fa3f643e
@@ -0,0 +1,25 @@
1
+ module SimplyAuth
2
+ class Application < Model
3
+ validates :name, presence: true
4
+ attr_accessor :name
5
+ def attributes
6
+ super.merge(name: name)
7
+ end
8
+
9
+ def signup_forms
10
+ @signup_forms ||= SignupForm.all(id)
11
+ end
12
+
13
+ def self.all
14
+ response = RestClient.get(
15
+ "https://api.simplyauth.com#{collection_path}",
16
+ accept: :json
17
+ )
18
+ body = JSON.parse(response.body)[model_name.element.pluralize.camelize(:lower)]
19
+ body.map do |data|
20
+ data = data.deep_transform_keys { |key| key.to_s.underscore }
21
+ new(data).tap{|a| a.persisted = true}
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,37 @@
1
+ module SimplyAuth
2
+ class SignupForm < Model
3
+ attr_accessor :name, :steps, :application_id
4
+ validates :name, :application_id, presence: true
5
+
6
+ def attributes
7
+ super.merge(name: name, steps: steps)
8
+ end
9
+
10
+ def owner_id
11
+ self.application_id
12
+ end
13
+
14
+ def self.owner_class_name
15
+ "Application"
16
+ end
17
+
18
+ def destroy
19
+ response = RestClient.delete(
20
+ "https://api.simplyauth.com#{instance_path}",
21
+ accept: :json
22
+ )
23
+ end
24
+
25
+ def self.all(ids)
26
+ response = RestClient.get(
27
+ "https://api.simplyauth.com#{collection_path(ids)}",
28
+ accept: :json
29
+ )
30
+ body = JSON.parse(response.body)[model_name.element.pluralize.camelize(:lower)]
31
+ body.map do |data|
32
+ data = data.deep_transform_keys { |key| key.to_s.underscore }
33
+ new(data)
34
+ end
35
+ end
36
+ end
37
+ end
@@ -20,6 +20,13 @@ module SimplyAuth
20
20
  "UserPool"
21
21
  end
22
22
 
23
+ def destroy
24
+ response = RestClient.delete(
25
+ "https://api.simplyauth.com#{instance_path}",
26
+ accept: :json
27
+ )
28
+ end
29
+
23
30
  def self.all(ids)
24
31
  response = RestClient.get(
25
32
  "https://api.simplyauth.com#{collection_path(ids)}",
@@ -27,7 +27,7 @@ module SimplyAuth
27
27
  end
28
28
 
29
29
  def users
30
- User.all(id)
30
+ @users ||= User.all(id)
31
31
  end
32
32
  end
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module SimplyAuth
2
- VERSION = '0.5.1'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simply_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Fogle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-07 00:00:00.000000000 Z
11
+ date: 2018-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -73,11 +73,13 @@ files:
73
73
  - app/jobs/simply_auth/application_job.rb
74
74
  - app/mailers/simply_auth/application_mailer.rb
75
75
  - app/mailers/simply_auth/password_mailer.rb
76
+ - app/models/simply_auth/application.rb
76
77
  - app/models/simply_auth/config.rb
77
78
  - app/models/simply_auth/model.rb
78
79
  - app/models/simply_auth/password_reset.rb
79
80
  - app/models/simply_auth/reset_password_token.rb
80
81
  - app/models/simply_auth/session.rb
82
+ - app/models/simply_auth/signup_form.rb
81
83
  - app/models/simply_auth/user.rb
82
84
  - app/models/simply_auth/user_pool.rb
83
85
  - app/views/layouts/simply_auth/application.html.erb
@@ -113,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
115
  version: '0'
114
116
  requirements: []
115
117
  rubyforge_project:
116
- rubygems_version: 2.6.12
118
+ rubygems_version: 2.7.6
117
119
  signing_key:
118
120
  specification_version: 4
119
121
  summary: The simple managed user service