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 CHANGED
@@ -1,3 +1,9 @@
1
- == 0.0.1
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
- ::Sequel::Model.descendants
12
+ Sequel::Model.descendents
24
13
  end
25
14
 
26
15
  def initialize(klass)
@@ -1,3 +1,3 @@
1
1
  module OrmAdapterSequel
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -3,5 +3,5 @@ $:.unshift(File.dirname(__FILE__) + '/../lib')
3
3
 
4
4
  require 'rspec'
5
5
  require 'sequel'
6
- require 'orm_adapter' # should be installed by our rake tasks
6
+ require 'orm_adapter'
7
7
  require 'orm_adapter-sequel'
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: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
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-09 00:00:00 -08:00
18
+ date: 2011-01-14 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency