attribute_mapper 0.9.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -7,6 +7,8 @@ Ticket model's status column is "open" or "closed" you would create the
7
7
  following mapping:
8
8
 
9
9
  class Ticket < ActiveRecord::Base
10
+ include AttributeMapper
11
+
10
12
  map_attribute :status, :to => {:open => 1, :closed => 2}
11
13
  end
12
14
 
data/Rakefile CHANGED
@@ -24,4 +24,4 @@ begin
24
24
  end
25
25
  rescue LoadError
26
26
  puts "Jeweler not available. Install it with: gem install technicalpickles-jeweler -s http://gems.github.com"
27
- end
27
+ end
@@ -1,4 +1,5 @@
1
1
  ---
2
- :minor: 9
3
- :patch: 1
4
- :major: 0
2
+ :patch: 0
3
+ :major: 1
4
+ :minor: 0
5
+ :build:
data/init.rb CHANGED
@@ -1,2 +1 @@
1
- require File.dirname(__FILE__) << "/lib/attribute_mapper"
2
- AttributeMapper.load
1
+ require File.join(File.dirname(__FILE__), "/lib/attribute_mapper")
@@ -1,16 +1,8 @@
1
1
  module AttributeMapper
2
2
 
3
- class << self
4
-
5
- def included(model)
6
- model.extend ClassMethods
7
- model.send(:include, InstanceMethods)
8
- end
9
-
10
- def load
11
- ActiveRecord::Base.send(:include, AttributeMapper)
12
- end
13
-
3
+ def self.included(model)
4
+ model.extend ClassMethods
5
+ model.send(:include, InstanceMethods)
14
6
  end
15
7
 
16
8
  module ClassMethods
@@ -1,11 +1,9 @@
1
1
  require 'test/unit'
2
2
  require 'shoulda'
3
- require 'active_record'
4
3
 
4
+ require 'active_record'
5
5
  require 'attribute_mapper'
6
6
 
7
- AttributeMapper.load
8
-
9
7
  ActiveRecord::Base.establish_connection(
10
8
  :adapter => 'sqlite3',
11
9
  :database => ':memory:'
@@ -19,6 +17,7 @@ end
19
17
 
20
18
  # Pseudo model for testing purposes
21
19
  class Ticket < ActiveRecord::Base
20
+ include AttributeMapper
22
21
  end
23
22
 
24
23
  class AttributeMapperTest < Test::Unit::TestCase
@@ -90,11 +89,11 @@ class AttributeMapperTest < Test::Unit::TestCase
90
89
  #######
91
90
  private
92
91
  #######
93
-
92
+
94
93
  def mapping(options = {})
95
94
  {:open => 1, :closed => 2}.merge(options)
96
95
  end
97
-
96
+
98
97
  def ticket
99
98
  @ticket ||= Ticket.new
100
99
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attribute_mapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcel Molina Jr.
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2009-10-26 00:00:00 -05:00
14
+ date: 2009-12-22 00:00:00 -06:00
15
15
  default_executable:
16
16
  dependencies: []
17
17