fossil 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/fossil.gemspec +2 -2
- data/lib/sequel/model_patch.rb +1 -1
- data/spec/sequel/model_patch_spec.rb +13 -4
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.7
|
data/fossil.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{fossil}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Patrick Lardin, Daniel Sudol"]
|
12
|
-
s.date = %q{2010-01-
|
12
|
+
s.date = %q{2010-01-25}
|
13
13
|
s.description = %q{Access FOS/betrieve db with this Sequel based orm wrapper}
|
14
14
|
s.email = %q{plardin@xojet.com}
|
15
15
|
s.files = [
|
data/lib/sequel/model_patch.rb
CHANGED
@@ -8,7 +8,7 @@ class Sequel::Model
|
|
8
8
|
# passing in an array of attribute names, fills a hash with values from the model.
|
9
9
|
def fill_hash(attributes)
|
10
10
|
attributes.inject({}) do |hash,attribute|
|
11
|
-
hash[attribute]=
|
11
|
+
hash[attribute]= send(attribute) if respond_to? attribute
|
12
12
|
hash
|
13
13
|
end
|
14
14
|
end
|
@@ -2,10 +2,19 @@ require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
2
|
require File.dirname(__FILE__) + '/spec_helper_tables' unless metaclass.class_variable_defined? :@@set_up_demo_tables
|
3
3
|
|
4
4
|
describe "Sequel::Model extentions" do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
|
6
|
+
describe "fill_hash method" do
|
7
|
+
|
8
|
+
it "works with attributes" do
|
9
|
+
Dude.first.should respond_to(:fill_hash)
|
10
|
+
Dude.first.fill_hash([:'kid - date']).should == {:'kid - date'=>1}
|
11
|
+
end
|
12
|
+
|
13
|
+
it "works with methods" do
|
14
|
+
Dude.column_alias :doo, :'kid - date'
|
15
|
+
Dude.first.fill_hash([:doo]).should == {:doo=>1}
|
16
|
+
end
|
17
|
+
|
9
18
|
end
|
10
19
|
|
11
20
|
it "can update and save" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fossil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Lardin, Daniel Sudol
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-25 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|