orm_adapter-sequel 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -1
- data/lib/orm_adapter-sequel/sequel.rb +2 -13
- data/lib/orm_adapter-sequel/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +4 -4
data/History.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
-
== 0.0.
|
1
|
+
== 0.0.2 (2011-01-14)
|
2
|
+
|
3
|
+
* Use Sequel Subclasses plugin to track descendents
|
4
|
+
http://sequel.rubyforge.org/rdoc-plugins/classes/Sequel/Plugins/Subclasses.html
|
5
|
+
Suggested by mooman [https://github.com/mooman]
|
6
|
+
|
7
|
+
== 0.0.1 (2011-01-09)
|
2
8
|
|
3
9
|
* Initial release [Don Morrison]
|
@@ -3,24 +3,13 @@ require 'sequel'
|
|
3
3
|
class Sequel::Model
|
4
4
|
extend OrmAdapter::ToAdapter
|
5
5
|
plugin :active_model
|
6
|
-
|
7
|
-
# Sequel: track models that inherit from Sequel::Model
|
8
|
-
# .descendants is used in Rails 3 and DM
|
9
|
-
def self.descendants
|
10
|
-
@@descendants ||= []
|
11
|
-
end
|
12
|
-
|
13
|
-
# Sequel: hook to track descendants
|
14
|
-
def self.inherited(subclass)
|
15
|
-
super
|
16
|
-
descendants << subclass unless descendants.include?(subclass)
|
17
|
-
end
|
6
|
+
plugin :subclasses
|
18
7
|
|
19
8
|
class OrmAdapter < ::OrmAdapter::Base
|
20
9
|
|
21
10
|
# Gets a list of the available models for this adapter
|
22
11
|
def self.model_classes
|
23
|
-
|
12
|
+
Sequel::Model.descendents
|
24
13
|
end
|
25
14
|
|
26
15
|
def initialize(klass)
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orm_adapter-sequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Don Morrison
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-14 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|