edr 0.0.5 → 0.0.6

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/.travis.yml ADDED
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 1.9.3
5
+ - 2.0.0
6
+
7
+ gemfile:
8
+ - Gemfile
9
+ - gemfiles/activerecord-4.0.gemfile
10
+
11
+ script: "bundle exec rspec spec"
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Edr
2
+ [![Build Status](https://travis-ci.org/nulogy/edr.png)](https://travis-ci.org/nulogy/edr)
2
3
 
3
- TODO: Write a gem description
4
+ Blog post describing EDR: ["Building Rich Domain Models in Rails. Separating Persistence"](http://engineering.nulogy.com/posts/building-rich-domain-models-in-rails-separating-persistence).
4
5
 
5
6
  ## Installation
6
7
 
@@ -16,14 +17,3 @@ Or install it yourself as:
16
17
 
17
18
  $ gem install edr
18
19
 
19
- ## Usage
20
-
21
- TODO: Write usage instructions here
22
-
23
- ## Contributing
24
-
25
- 1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Add some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in edr.gemspec
4
+ gemspec path: "../"
5
+
6
+ gem 'activerecord', '~> 4.0.0.rc1'
7
+ # https://github.com/bmabey/database_cleaner/commit/ce1d16298960c28182568611892bfa4c386cfaf5
8
+ gem 'database_cleaner', github: 'bmabey/database_cleaner', ref: 'ce1d16298960c28182568611892bfa4c386cfaf5'
@@ -8,7 +8,7 @@ module Edr
8
8
  data_object.save!
9
9
 
10
10
  model.id = data_object.id if model.respond_to?(:id)
11
- model.send(:repository=, self) if model.respond_to?(:repository)
11
+ model.send(:repository=, self) if model.respond_to?(:repository, true)
12
12
 
13
13
  model
14
14
  end
data/lib/edr/model.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'forwardable'
1
2
  require_relative 'registry'
2
3
 
3
4
  module Edr
data/lib/edr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Edr
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/spec/test_data.rb CHANGED
@@ -26,8 +26,6 @@ end
26
26
  class OrderData < ActiveRecord::Base
27
27
  self.table_name = "orders"
28
28
 
29
- attr_accessible :amount, :deliver_at
30
-
31
29
  validates :amount, numericality: true
32
30
  has_many :items, class_name: 'ItemData', foreign_key: 'order_id'
33
31
  end
@@ -35,8 +33,6 @@ end
35
33
  class ItemData < ActiveRecord::Base
36
34
  self.table_name = "items"
37
35
 
38
- attr_accessible :amount, :name
39
-
40
36
  validates :amount, numericality: true
41
37
  validates :name, presence: true
42
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2012-11-21 00:00:00.000000000 Z
15
+ date: 2013-05-06 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rspec
@@ -121,11 +121,13 @@ extensions: []
121
121
  extra_rdoc_files: []
122
122
  files:
123
123
  - .gitignore
124
+ - .travis.yml
124
125
  - Gemfile
125
126
  - LICENSE.txt
126
127
  - README.md
127
128
  - Rakefile
128
129
  - edr.gemspec
130
+ - gemfiles/activerecord-4.0.gemfile
129
131
  - lib/edr.rb
130
132
  - lib/edr/ar/data_validator.rb
131
133
  - lib/edr/ar/repository.rb
@@ -150,12 +152,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
152
  - - ! '>='
151
153
  - !ruby/object:Gem::Version
152
154
  version: '0'
155
+ segments:
156
+ - 0
157
+ hash: 4201349893603116254
153
158
  required_rubygems_version: !ruby/object:Gem::Requirement
154
159
  none: false
155
160
  requirements:
156
161
  - - ! '>='
157
162
  - !ruby/object:Gem::Version
158
163
  version: '0'
164
+ segments:
165
+ - 0
166
+ hash: 4201349893603116254
159
167
  requirements: []
160
168
  rubyforge_project:
161
169
  rubygems_version: 1.8.24