sequel-devise 0.0.7 → 0.0.8
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 +4 -4
- data/README.md +39 -4
- data/lib/sequel-devise/version.rb +1 -1
- data/lib/sequel/plugins/devise.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee1ada8322c87945f72ca5e36e433fcce01abc92
|
4
|
+
data.tar.gz: 08b1e5fd2331d2603ea71c6f24051f4666327ee7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfee62ba58029181fc6b1713376ad29b88956d92e7d81b95b7ef10f842bcfaec3c7ddc59ffba35309332e26f4366bd7141780ca7cd7b26a20d588e4d665ee057
|
7
|
+
data.tar.gz: 458e8c1f5d31f36ceeaf726cad67dfda73d0ac917f7b170661eb8aab6093cda7ad9f9aec964034e2b24249db210eca2f9e00ffe478ddcd7350dd2b63f0359781
|
data/README.md
CHANGED
@@ -26,6 +26,45 @@ Or install it yourself as:
|
|
26
26
|
If you're interested in more instructions on using Sequel with Rails,
|
27
27
|
I've written [some instructions](http://rosenfeld.herokuapp.com/en/articles/2012-04-18-getting-started-with-sequel-in-rails) in my web site.
|
28
28
|
|
29
|
+
## Important Note
|
30
|
+
|
31
|
+
Unfortunately Devise does not rely on the `orm_adapter` specs as
|
32
|
+
[it was supposed to](https://github.com/plataformatec/devise/blob/master/devise.gemspec#L22).
|
33
|
+
|
34
|
+
It will assume the model support other methods besides those defined by `orm_adapter` and that they
|
35
|
+
behave like the equivalent in ActiveRecord supporting the same arguments.
|
36
|
+
|
37
|
+
In some cases, it will call some method which is not defined by `Sequel::Model`, so we implement
|
38
|
+
them in this gem, but there are some cases which are trickier. For example, Devise will call the
|
39
|
+
`save` method in the model and expect it to return false if the validation fails. This is not the
|
40
|
+
default behavior of Sequel::Model, so you'll have to change this behavior for your User classes
|
41
|
+
that are intended to be used by Devise. There are a few solutions depending on your use case:
|
42
|
+
|
43
|
+
### You expect your Sequel Models to not raise on save failure by default
|
44
|
+
|
45
|
+
Just disable the raise behavior by default:
|
46
|
+
|
47
|
+
Sequel::Model.raise_on_save_failure = false
|
48
|
+
|
49
|
+
### You are okay with changing the raise behavior only for your user classes
|
50
|
+
|
51
|
+
class User < Sequel::Model
|
52
|
+
self.raise_on_save_failure = false
|
53
|
+
plugin :devise
|
54
|
+
devise :database_authenticatable
|
55
|
+
end
|
56
|
+
|
57
|
+
### You don't want to touch your user model just to accomodate Devise
|
58
|
+
|
59
|
+
You are free to simply create another user class that is meant to be used by Devise while the
|
60
|
+
remaining of your application just use your regular user class:
|
61
|
+
|
62
|
+
class DeviseUser < User
|
63
|
+
self.raise_on_save_failure = false
|
64
|
+
plugin :devise
|
65
|
+
devise :database_authenticatable
|
66
|
+
end
|
67
|
+
|
29
68
|
## Contributing
|
30
69
|
|
31
70
|
1. Fork it
|
@@ -34,7 +73,3 @@ I've written [some instructions](http://rosenfeld.herokuapp.com/en/articles/2012
|
|
34
73
|
4. Push to the branch (`git push origin my-new-feature`)
|
35
74
|
5. Create new Pull Request
|
36
75
|
|
37
|
-
|
38
|
-
|
39
|
-
[](https://bitdeli.com/free "Bitdeli Badge")
|
40
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel-devise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Rosenfeld Rosas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: devise
|
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
75
|
rubyforge_project:
|
76
|
-
rubygems_version: 2.
|
76
|
+
rubygems_version: 2.5.1
|
77
77
|
signing_key:
|
78
78
|
specification_version: 4
|
79
79
|
summary: Enable Devise support by adding plugin :devise to your Sequel Model
|