sequel-devise 0.0.7 → 0.0.8

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
2
  SHA1:
3
- metadata.gz: 2add1270ffb57193745013de3c96b00b02f08f9f
4
- data.tar.gz: 7690e44ad5014197c65c9b1699f0062e66e0e867
3
+ metadata.gz: ee1ada8322c87945f72ca5e36e433fcce01abc92
4
+ data.tar.gz: 08b1e5fd2331d2603ea71c6f24051f4666327ee7
5
5
  SHA512:
6
- metadata.gz: 1bd709f40cd7f5eb7fe46ee2237fd34b09dde7bd673e5b304783169738cb6aab213a23b7c2c28d5163d8101e4fdb0b35e9a96ad6629ac27dcf22c243b71c3c2c
7
- data.tar.gz: 0c23df7be43fb98c75be3ade3036730a3d68a5635387b0dd726046159aa38d09d24a2145f2a9a3e8d0c1bd6cbe29c9b9d99d6195a3881ca40c346175e14d8314
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
- [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rosenfeld/sequel-devise/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
40
-
@@ -1,5 +1,5 @@
1
1
  module Sequel
2
2
  module Devise
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
@@ -44,6 +44,11 @@ module Sequel
44
44
  end
45
45
 
46
46
  module ClassMethods
47
+
48
+ def human_attribute_name(key)
49
+ key.to_s
50
+ end
51
+
47
52
  Model::HOOKS.each do |hook|
48
53
  define_method(hook) do |method = nil, options = {}, &block|
49
54
  if Symbol === (if_method = options[:if])
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.7
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: 2015-12-14 00:00:00.000000000 Z
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.4.5.1
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