nano-store 0.3.9 → 0.3.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,10 +8,10 @@ module NanoStore
8
8
  end
9
9
 
10
10
  if sort_options.empty?
11
- self.store.objectsOfClassNamed(self.to_s)
11
+ self.store.objectsOfClassNamed(self.bare_class_name)
12
12
  else
13
13
  sort_descriptors = sort_descriptor_with_options(sort_options)
14
- self.store.objectsOfClassNamed(self.to_s, usingSortDescriptors:sort_descriptors)
14
+ self.store.objectsOfClassNamed(self.bare_class_name, usingSortDescriptors:sort_descriptors)
15
15
  end
16
16
  end
17
17
 
@@ -114,8 +114,12 @@ module NanoStore
114
114
  searchResults.select {|r| r.class.to_s == self.to_s }.collect(&:key)
115
115
  end
116
116
 
117
+ def bare_class_name
118
+ self.to_s.split("::").last.capitalize
119
+ end
120
+
117
121
  def object_class_name
118
- "k#{self.to_s.capitalize}"
122
+ "k#{bare_class_name}"
119
123
  end
120
124
 
121
125
  private
@@ -136,7 +136,7 @@ class NSFNanoStore
136
136
 
137
137
  # Count number of this class objects in store
138
138
  def count(clazz)
139
- self.countOfObjectsOfClassNamed(clazz.to_s)
139
+ self.countOfObjectsOfClassNamed(clazz.bare_class_name)
140
140
  end
141
141
 
142
142
  # Create a transaction
@@ -1,3 +1,3 @@
1
1
  module NanoStore
2
- VERSION = "0.3.9"
2
+ VERSION = "0.3.10"
3
3
  end
data/spec/finder_spec.rb CHANGED
@@ -1,10 +1,11 @@
1
1
  describe "Finder" do
2
- class Car < NanoStore::Model
2
+ module CustomModule; end
3
+ class CustomModule::Car < NanoStore::Model
3
4
  attribute :name
4
5
  attribute :created_at
5
6
  end
6
-
7
-
7
+ Car = CustomModule::Car
8
+
8
9
  def stub_user(name, age, created_at)
9
10
  user = User.new
10
11
  user.name = name
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nano-store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bubble-wrap
16
- requirement: &70240847333780 !ruby/object:Gem::Requirement
16
+ requirement: &70355674794300 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.1.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70240847333780
24
+ version_requirements: *70355674794300
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: motion-cocoapods
27
- requirement: &70240847333180 !ruby/object:Gem::Requirement
27
+ requirement: &70355674793680 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70240847333180
35
+ version_requirements: *70355674793680
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: motion-redgreen
38
- requirement: &70240847332740 !ruby/object:Gem::Requirement
38
+ requirement: &70355674793260 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70240847332740
46
+ version_requirements: *70355674793260
47
47
  description: Wrapper for NanoStore, a lightweight schema-less key-value document database
48
48
  based on sqlite, for RubyMotion.
49
49
  email: