devise_sequel 0.0.2 → 0.0.3
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.
data/README.md
CHANGED
|
@@ -3,7 +3,23 @@ Sequel mapping to Devise
|
|
|
3
3
|
|
|
4
4
|
**At least version 1.2.rc of Devise is required**
|
|
5
5
|
|
|
6
|
-
Please report any issues
|
|
6
|
+
Please report any issues!
|
|
7
|
+
|
|
8
|
+
Installation
|
|
9
|
+
------------
|
|
10
|
+
|
|
11
|
+
# bundler
|
|
12
|
+
gem 'devise_sequel'
|
|
13
|
+
|
|
14
|
+
Also, at the moment (0.0.3) please use the orm_adapter-sequel from my repository, which is a fork from the real project from elskwid: https://github.com/mooman/orm_adapter-sequel
|
|
15
|
+
This should be very temporary.
|
|
16
|
+
|
|
17
|
+
You're going to need an ORM for rails also. Only sequel-rails has been tested to work this gem.
|
|
18
|
+
|
|
19
|
+
Usage
|
|
20
|
+
-----
|
|
21
|
+
|
|
22
|
+
There are no generators at this point, but it's pretty easy to get started:
|
|
7
23
|
|
|
8
24
|
I like to extend only the models I need for Devise:
|
|
9
25
|
|
|
@@ -14,12 +30,34 @@ I like to extend only the models I need for Devise:
|
|
|
14
30
|
# usually active_model is included already in any Sequel Rails 3 connectors
|
|
15
31
|
# plugin :active_model
|
|
16
32
|
|
|
17
|
-
devise ...
|
|
33
|
+
devise ... # put the devise modules you want here
|
|
18
34
|
end
|
|
19
35
|
|
|
20
|
-
But if you want them to be globally available for all your
|
|
36
|
+
But if you want them to be globally available for all your Sequel models, then uncomment the lines at the bottom of the sequel.rb file in the plugin. Hopefully this can be more elegant in the future where you can set an option somewhere.
|
|
37
|
+
|
|
38
|
+
For schema migration, you can do something like this:
|
|
39
|
+
|
|
40
|
+
Sequel.migration do
|
|
41
|
+
up do
|
|
42
|
+
create_table :users do
|
|
43
|
+
database_authenticatable
|
|
44
|
+
confirmable
|
|
45
|
+
recoverable
|
|
46
|
+
rememberable
|
|
47
|
+
trackable
|
|
48
|
+
lockable
|
|
49
|
+
|
|
50
|
+
DateTime :created_at
|
|
51
|
+
DateTime :updated_at
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
down do
|
|
56
|
+
drop_table :users
|
|
57
|
+
end
|
|
58
|
+
end
|
|
21
59
|
|
|
22
|
-
|
|
60
|
+
Very similar to the devise active record example. "database_authenticatable" creates an autoincrementing primary key "id" field for you.
|
|
23
61
|
|
|
24
62
|
Credits / Contributors
|
|
25
63
|
======================
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require 'rake'
|
|
2
|
+
|
|
3
|
+
Gem::Specification.new do |s|
|
|
4
|
+
s.name = "devise_sequel"
|
|
5
|
+
s.version = '0.0.3'
|
|
6
|
+
s.platform = Gem::Platform::RUBY
|
|
7
|
+
s.authors = ["Rachot Moragraan"]
|
|
8
|
+
s.description = "Sequel support for Devise"
|
|
9
|
+
s.summary = "Sequel support for Devise"
|
|
10
|
+
s.email = "janechii@gmail.com"
|
|
11
|
+
s.homepage = "http://github.com/mooman/devise_sequel"
|
|
12
|
+
|
|
13
|
+
s.rubyforge_project = "devise_sequel"
|
|
14
|
+
s.required_rubygems_version = ">= 1.3.6"
|
|
15
|
+
|
|
16
|
+
s.files = `git ls-files`.split("\n")
|
|
17
|
+
s.require_paths = ["lib"]
|
|
18
|
+
s.has_rdoc = false
|
|
19
|
+
|
|
20
|
+
s.add_dependency "orm_adapter-sequel"
|
|
21
|
+
s.add_dependency "devise", '>= 1.2.rc'
|
|
22
|
+
s.add_dependency "sequel"
|
|
23
|
+
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Sequel.migration do
|
|
2
2
|
up do
|
|
3
3
|
create_table :users do
|
|
4
|
-
primary_key :id
|
|
5
4
|
String :username
|
|
6
5
|
String :facebook_token
|
|
7
6
|
|
|
@@ -18,7 +17,6 @@ Sequel.migration do
|
|
|
18
17
|
end
|
|
19
18
|
|
|
20
19
|
create_table :admins do
|
|
21
|
-
primary_key :id
|
|
22
20
|
database_authenticatable :null => true
|
|
23
21
|
encryptable
|
|
24
22
|
rememberable :use_salt => false
|
data/test/test_helper.rb
CHANGED
|
@@ -12,15 +12,13 @@ require "orm/sequel"
|
|
|
12
12
|
|
|
13
13
|
I18n.load_path << "#{DEVISE_PATH}/test/support/locale/en.yml"
|
|
14
14
|
require 'mocha'
|
|
15
|
-
require 'webrat'
|
|
16
15
|
|
|
16
|
+
require 'webrat'
|
|
17
17
|
Webrat.configure do |config|
|
|
18
18
|
config.mode = :rails
|
|
19
19
|
config.open_error_files = false
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
Devise::OmniAuth.test_mode!
|
|
23
|
-
|
|
24
22
|
# Add support to load paths so we can overwrite broken webrat setup
|
|
25
23
|
$:.unshift "#{DEVISE_PATH}/test/support"
|
|
26
24
|
Dir["#{DEVISE_PATH}/test/support/**/*.rb"].each { |f| require f }
|
metadata
CHANGED
|
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
|
5
5
|
segments:
|
|
6
6
|
- 0
|
|
7
7
|
- 0
|
|
8
|
-
-
|
|
9
|
-
version: 0.0.
|
|
8
|
+
- 3
|
|
9
|
+
version: 0.0.3
|
|
10
10
|
platform: ruby
|
|
11
11
|
authors:
|
|
12
12
|
- Rachot Moragraan
|
|
@@ -14,7 +14,7 @@ autorequire:
|
|
|
14
14
|
bindir: bin
|
|
15
15
|
cert_chain: []
|
|
16
16
|
|
|
17
|
-
date: 2011-
|
|
17
|
+
date: 2011-04-24 00:00:00 -07:00
|
|
18
18
|
default_executable:
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|
|
@@ -71,6 +71,7 @@ files:
|
|
|
71
71
|
- MIT-LICENSE
|
|
72
72
|
- README.md
|
|
73
73
|
- Rakefile
|
|
74
|
+
- devise_sequel.gemspec
|
|
74
75
|
- lib/devise/orm/sequel.rb
|
|
75
76
|
- lib/devise/orm/sequel/compatibility.rb
|
|
76
77
|
- lib/devise/orm/sequel/schema.rb
|