minimapper 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,6 +19,13 @@ module Minimapper
19
19
  attributes[attribute] = Convert.new(value).to(type)
20
20
  end
21
21
  end
22
+
23
+ @@column_names ||= []
24
+ @@column_names |= list
25
+ end
26
+
27
+ def column_names
28
+ @@column_names.map { |column| column.is_a?(Array) ? column.first : column }.map(&:to_s)
22
29
  end
23
30
  end
24
31
  end
@@ -1,3 +1,3 @@
1
1
  module Minimapper
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/unit/entity_spec.rb CHANGED
@@ -76,3 +76,10 @@ describe Minimapper::Entity, "attributes" do
76
76
  entity.attributes.should == { :id => 5, :created_at => time }
77
77
  end
78
78
  end
79
+
80
+ describe Minimapper::Entity, "self.column_names" do
81
+ it "returns all attributes as strings" do
82
+ # used by some rails plugins
83
+ TestUser.column_names.should == [ "id", "created_at", "updated_at", "name" ]
84
+ end
85
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-11-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70175304808520 !ruby/object:Gem::Requirement
16
+ requirement: &70350098645360 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70175304808520
24
+ version_requirements: *70350098645360
25
25
  description: A minimalistic way of separating your models from ORMs like ActiveRecord.
26
26
  email:
27
27
  - joakim.kolsjo@gmail.com
@@ -77,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  segments:
79
79
  - 0
80
- hash: 899466324574471464
80
+ hash: 4282956153133681718
81
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  none: false
83
83
  requirements:
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  version: '0'
87
87
  segments:
88
88
  - 0
89
- hash: 899466324574471464
89
+ hash: 4282956153133681718
90
90
  requirements: []
91
91
  rubyforge_project:
92
92
  rubygems_version: 1.8.5