storage_room 0.3.12 → 0.3.13
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/VERSION +1 -1
- data/lib/storage_room.rb +1 -1
- data/lib/storage_room/models/collection.rb +2 -1
- data/spec/fixtures/collection.json +1 -0
- data/spec/fixtures/collections.json +1 -0
- data/spec/fixtures/export_collection.json +1 -0
- data/spec/storage_room/models/collection_spec.rb +2 -1
- data/spec/storage_room/models/entry_spec.rb +1 -1
- data/spec/storage_room_spec.rb +1 -1
- data/storage_room.gemspec +2 -2
- metadata +3 -3
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.13
|
data/lib/storage_room.rb
CHANGED
@@ -2,6 +2,7 @@ module StorageRoom
|
|
2
2
|
# A collection is used to define the structure of a data set.
|
3
3
|
class Collection < Model
|
4
4
|
key :name
|
5
|
+
key :entry_type
|
5
6
|
key :primary_field_identifier
|
6
7
|
|
7
8
|
many :fields
|
@@ -24,7 +25,7 @@ module StorageRoom
|
|
24
25
|
|
25
26
|
# The class name of the collection's entries, can be overridden with a mapping
|
26
27
|
def entry_class_name
|
27
|
-
ensure_loaded { StorageRoom.entry_class_for_name(
|
28
|
+
ensure_loaded { StorageRoom.entry_class_for_name(entry_type)}
|
28
29
|
end
|
29
30
|
|
30
31
|
# The class for the collection's entries
|
@@ -1,6 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"collection": {
|
3
3
|
"name": "Guidebooks",
|
4
|
+
"entry_type": "Guidebook",
|
4
5
|
"@updated_at": "2010-11-05T12:55:04Z",
|
5
6
|
"@entries_url": "http://api.storageroomapp.com/accounts/4c8fd48542507175aa00002f/collections/4ddaf68b4d085d374a000003/entries",
|
6
7
|
"@created_at": "2010-09-14T20:01:13Z",
|
@@ -4,6 +4,7 @@
|
|
4
4
|
"@url": "http://api.storageroomapp.com/accounts/4c8fd48542507175aa00002f/collections",
|
5
5
|
"resources": [{
|
6
6
|
"name": "Guidebooks",
|
7
|
+
"entry_type": "Guidebook",
|
7
8
|
"@updated_at": "2010-11-05T12:55:04Z",
|
8
9
|
"@entries_url": "http://api.storageroomapp.com/accounts/4c8fd48542507175aa00002f/collections/4ddaf68b4d085d374a000003/entries",
|
9
10
|
"@created_at": "2010-09-14T20:01:13Z",
|
@@ -6,7 +6,7 @@ end
|
|
6
6
|
describe StorageRoom::Collection do
|
7
7
|
before(:each) do
|
8
8
|
@field = StorageRoom::StringField.new(:name => 'Name', :identifier => 'name')
|
9
|
-
@collection = StorageRoom::Collection.new(:name => 'Restaurant', :fields => [@field])
|
9
|
+
@collection = StorageRoom::Collection.new(:name => 'Restaurant', :entry_type => 'Restaurant', :fields => [@field])
|
10
10
|
@collection.response_data[:@version] = 1
|
11
11
|
@collection.response_data[:@url] = "URL"
|
12
12
|
|
@@ -103,6 +103,7 @@ describe StorageRoom::Collection do
|
|
103
103
|
|
104
104
|
it "should raise an error if class doesn't inherit from StorageRoom::Entry" do
|
105
105
|
@collection.name = "RaiseError"
|
106
|
+
@collection.entry_type = "RaiseError"
|
106
107
|
lambda {
|
107
108
|
klass = @collection.entry_class
|
108
109
|
}.should raise_error(RuntimeError)
|
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
|
3
3
|
describe StorageRoom::Entry do
|
4
4
|
before(:each) do
|
5
5
|
@string_field = StorageRoom::StringField.new(:name => 'Name', :identifier => 'name')
|
6
|
-
@collection = StorageRoom::Collection.new(:name => 'Report', :fields => [@string_field])
|
6
|
+
@collection = StorageRoom::Collection.new(:name => 'Report', :entry_type => 'Report', :fields => [@string_field])
|
7
7
|
@collection.response_data[:@url] = '/collections/COLLECTION_ID'
|
8
8
|
@collection.entry_class
|
9
9
|
end
|
data/spec/storage_room_spec.rb
CHANGED
@@ -107,7 +107,7 @@ describe StorageRoom do
|
|
107
107
|
end
|
108
108
|
|
109
109
|
it "should return without mapping" do
|
110
|
-
StorageRoom.entry_class_for_name('
|
110
|
+
StorageRoom.entry_class_for_name('RestaurantVisit').should == 'RestaurantVisit'
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
data/storage_room.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{storage_room}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.13"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Sascha Konietzke"]
|
12
|
-
s.date = %q{2011-08-
|
12
|
+
s.date = %q{2011-08-15}
|
13
13
|
s.description = %q{StorageRoom is a CMS system for Mobile Applications (iPhone, Android, BlackBerry, ...). This library gives you an ActiveModel-like interface to your data.}
|
14
14
|
s.email = %q{sascha@thriventures.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 13
|
9
|
+
version: 0.3.13
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Sascha Konietzke
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-08-
|
17
|
+
date: 2011-08-15 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|