fossil 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.7
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fossil}
8
- s.version = "0.2.6"
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-24}
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 = [
@@ -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]= values[attribute] if values.has_key?(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
- it "has fill_hash method" do
7
- Dude.first.should respond_to(:fill_hash)
8
- Dude.first.fill_hash([:'kid - date']).should == {:'kid - date'=>1}
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.6
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-24 00:00:00 -06:00
12
+ date: 2010-01-25 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency