datamappify 0.51.1 → 0.52.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +44 -17
- data/datamappify.gemspec +2 -2
- data/lib/datamappify/data/criteria/active_record/save.rb +5 -1
- data/lib/datamappify/data/criteria/common.rb +26 -20
- data/lib/datamappify/data/criteria/concerns/update_primary_record.rb +28 -0
- data/lib/datamappify/data/criteria/relational/concerns/set_criteria.rb +36 -0
- data/lib/datamappify/data/criteria/relational/find.rb +2 -0
- data/lib/datamappify/data/criteria/relational/find_by_key.rb +4 -3
- data/lib/datamappify/data/criteria/relational/save.rb +2 -0
- data/lib/datamappify/data/criteria/relational/save_by_key.rb +5 -3
- data/lib/datamappify/data/criteria/sequel/save.rb +5 -1
- data/lib/datamappify/data/mapper/attribute.rb +38 -17
- data/lib/datamappify/data/mapper.rb +7 -5
- data/lib/datamappify/data/provider/active_record.rb +7 -0
- data/lib/datamappify/data/provider/sequel.rb +8 -1
- data/lib/datamappify/data/record.rb +4 -0
- data/lib/datamappify/entity/composable/attribute.rb +16 -0
- data/lib/datamappify/entity/composable/attributes.rb +54 -0
- data/lib/datamappify/entity/composable/validators.rb +63 -0
- data/lib/datamappify/entity/composable.rb +6 -87
- data/lib/datamappify/entity.rb +2 -2
- data/lib/datamappify/repository/mapping_dsl.rb +2 -2
- data/lib/datamappify/repository/query_method/method.rb +15 -4
- data/lib/datamappify/version.rb +1 -1
- data/spec/entity/composable_spec.rb +3 -3
- data/spec/repository/reverse_mapped_spec.rb +56 -0
- data/spec/support/entities/author.rb +6 -0
- data/spec/support/entities/computer_hardware.rb +2 -2
- data/spec/support/entities/post.rb +9 -0
- data/spec/support/repositories/active_record/author_repository.rb +6 -0
- data/spec/support/repositories/active_record/post_repository.rb +9 -0
- data/spec/support/repositories/sequel/author_repository.rb +6 -0
- data/spec/support/repositories/sequel/post_repository.rb +9 -0
- data/spec/support/tables/active_record.rb +13 -0
- data/spec/support/tables/sequel.rb +17 -0
- data/spec/unit/entity/composable_spec.rb +3 -3
- metadata +35 -8
@@ -0,0 +1,54 @@
|
|
1
|
+
module Datamappify
|
2
|
+
module Entity
|
3
|
+
module Composable
|
4
|
+
class Attributes
|
5
|
+
class << self
|
6
|
+
def build(entity, entity_class, options)
|
7
|
+
@entity = entity
|
8
|
+
@entity_class = entity_class
|
9
|
+
@options = options
|
10
|
+
|
11
|
+
build_attributes
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
# @return (see #attributes_from)
|
17
|
+
def build_attributes
|
18
|
+
@entity_class.attribute_set.each do |attribute|
|
19
|
+
unless excluded_attributes.include?(attribute.name)
|
20
|
+
@entity.attribute_set << build_attribute(attribute.name, attribute.writer)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# @return [Array]
|
26
|
+
def excluded_attributes
|
27
|
+
@excluded_attributes ||= @entity_class.reference_keys << :id
|
28
|
+
end
|
29
|
+
|
30
|
+
# @param attribute_name [Symbol]
|
31
|
+
#
|
32
|
+
# @param attribute_writer [Virtus::Attribute::Writer]
|
33
|
+
#
|
34
|
+
# @return [Virtus::Attribute]
|
35
|
+
def build_attribute(attribute_name, attribute_writer)
|
36
|
+
name = if @options[:prefix_with]
|
37
|
+
Attribute.prefix(attribute_name, @options[:prefix_with])
|
38
|
+
else
|
39
|
+
attribute_name
|
40
|
+
end
|
41
|
+
|
42
|
+
Virtus::Attribute.build(
|
43
|
+
name,
|
44
|
+
attribute_writer.primitive,
|
45
|
+
:default => attribute_writer.default_value,
|
46
|
+
:visibility => attribute_writer.visibility,
|
47
|
+
:coercer => attribute_writer.coercer
|
48
|
+
)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Datamappify
|
2
|
+
module Entity
|
3
|
+
module Composable
|
4
|
+
class Validators
|
5
|
+
class << self
|
6
|
+
def build(entity, entity_class, options)
|
7
|
+
@entity = entity
|
8
|
+
@entity_class = entity_class
|
9
|
+
@options = options
|
10
|
+
|
11
|
+
build_validators
|
12
|
+
run_validators
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
# @return (see #attributes_from)
|
18
|
+
def build_validators
|
19
|
+
if @options[:prefix_with]
|
20
|
+
rename_validators(@options[:prefix_with])
|
21
|
+
else
|
22
|
+
@entity_class._validators.each { |k, v| @entity._validators[k] = v.dup }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# @param prefix [Symbol]
|
27
|
+
#
|
28
|
+
# @return [void]
|
29
|
+
def rename_validators(prefix)
|
30
|
+
@entity_class._validators.each do |attribute_name, validators|
|
31
|
+
@entity._validators[Attribute.prefix(attribute_name, prefix)] = validators.map do |validator|
|
32
|
+
rename_validator_attributes(validator.dup, prefix)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# @param validator [Validator]
|
38
|
+
#
|
39
|
+
# @param prefix (see #rename_validators)
|
40
|
+
#
|
41
|
+
# @return [void]
|
42
|
+
def rename_validator_attributes(validator, prefix)
|
43
|
+
validator.instance_variable_set(
|
44
|
+
:@attributes,
|
45
|
+
validator.attributes.map { |name| Attribute.prefix(name, prefix) }
|
46
|
+
)
|
47
|
+
|
48
|
+
validator
|
49
|
+
end
|
50
|
+
|
51
|
+
# @return [void]
|
52
|
+
def run_validators
|
53
|
+
@entity._validators.each do |_, validators|
|
54
|
+
validators.each do |validator|
|
55
|
+
@entity.validate(validator, validator.options)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -1,3 +1,7 @@
|
|
1
|
+
require 'datamappify/entity/composable/attribute'
|
2
|
+
require 'datamappify/entity/composable/attributes'
|
3
|
+
require 'datamappify/entity/composable/validators'
|
4
|
+
|
1
5
|
module Datamappify
|
2
6
|
module Entity
|
3
7
|
module Composable
|
@@ -12,93 +16,8 @@ module Datamappify
|
|
12
16
|
#
|
13
17
|
# @return [void]
|
14
18
|
def attributes_from(entity_class, options = {})
|
15
|
-
|
16
|
-
|
17
|
-
run_validators
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
# @param (see #attributes_from)
|
23
|
-
#
|
24
|
-
# @return (see #attributes_from)
|
25
|
-
def setup_attributes(entity_class, options)
|
26
|
-
entity_class.attribute_set.each do |attribute|
|
27
|
-
unless excluded_attributes(entity_class).include?(attribute.name)
|
28
|
-
self.attribute_set << tweak_attribute(attribute.dup, options)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
# @param (see #attributes_from)
|
34
|
-
#
|
35
|
-
# @return (see #attributes_from)
|
36
|
-
def setup_validators(entity_class, options)
|
37
|
-
if options[:prefix_with]
|
38
|
-
rename_validators(entity_class, options[:prefix_with])
|
39
|
-
else
|
40
|
-
entity_class._validators.each { |k, v| self._validators[k] = v.dup }
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
# @return [void]
|
45
|
-
def run_validators
|
46
|
-
self._validators.each do |_, validators|
|
47
|
-
validators.each do |validator|
|
48
|
-
validate(validator, validator.options)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
# @param entity_class [Entity]
|
54
|
-
#
|
55
|
-
# @param prefix [Symbol]
|
56
|
-
#
|
57
|
-
# @return [void]
|
58
|
-
def rename_validators(entity_class, prefix)
|
59
|
-
entity_class._validators.each do |attribute_name, validators|
|
60
|
-
self._validators[:"#{prefix}_#{attribute_name}"] = validators.map do |validator|
|
61
|
-
rename_validator_attributes(validator.dup, prefix)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# @param validator [Validator]
|
67
|
-
#
|
68
|
-
# @param prefix (see #rename_validators)
|
69
|
-
#
|
70
|
-
# @return [void]
|
71
|
-
def rename_validator_attributes(validator, prefix)
|
72
|
-
validator.instance_variable_set :@attributes, validator.attributes.map { |name| :"#{prefix}_#{name}" }
|
73
|
-
validator
|
74
|
-
end
|
75
|
-
|
76
|
-
# @param entity_class [Entity]
|
77
|
-
#
|
78
|
-
# @return [Array]
|
79
|
-
def excluded_attributes(entity_class)
|
80
|
-
@excluded_attributes ||= entity_class.reference_keys << :id
|
81
|
-
end
|
82
|
-
|
83
|
-
# @param attribute [Virtus::Attribute]
|
84
|
-
#
|
85
|
-
# @param options [Hash]
|
86
|
-
#
|
87
|
-
# @return [Virtus::Attribute]
|
88
|
-
def tweak_attribute(attribute, options)
|
89
|
-
prefix_attribute_name(attribute, options[:prefix_with]) if options[:prefix_with]
|
90
|
-
|
91
|
-
attribute
|
92
|
-
end
|
93
|
-
|
94
|
-
# @param attribute [Virtus::Attribute]
|
95
|
-
#
|
96
|
-
# @param prefix [Symbol]
|
97
|
-
#
|
98
|
-
# @return [void]
|
99
|
-
def prefix_attribute_name(attribute, prefix)
|
100
|
-
name = attribute.instance_variable_set :@name, :"#{prefix}_#{attribute.name}"
|
101
|
-
attribute.instance_variable_set :@instance_variable_name, "@#{name}".to_sym
|
19
|
+
Attributes.build(self, entity_class, options)
|
20
|
+
Validators.build(self, entity_class, options)
|
102
21
|
end
|
103
22
|
end
|
104
23
|
end
|
data/lib/datamappify/entity.rb
CHANGED
@@ -10,10 +10,10 @@ module Datamappify
|
|
10
10
|
def self.included(klass)
|
11
11
|
klass.class_eval do
|
12
12
|
include Observable
|
13
|
-
include Virtus
|
14
|
-
include Virtus::Equalizer.new(inspect)
|
15
13
|
include ::ActiveModel::Model
|
16
14
|
include ActiveModel::Compatibility
|
15
|
+
include Virtus
|
16
|
+
include Virtus::Equalizer.new(inspect)
|
17
17
|
include LazyChecking
|
18
18
|
include Composable
|
19
19
|
include Relation
|
@@ -26,8 +26,8 @@ module Datamappify
|
|
26
26
|
# @param (see Data::Mapper::Attribute#initialize)
|
27
27
|
#
|
28
28
|
# @return [void]
|
29
|
-
def map_attribute(name, source)
|
30
|
-
data_mapper.custom_mapping[name] = source
|
29
|
+
def map_attribute(name, source, options = {})
|
30
|
+
data_mapper.custom_mapping[name] = [source, options]
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -73,11 +73,22 @@ module Datamappify
|
|
73
73
|
# @param entity [Entity]
|
74
74
|
#
|
75
75
|
# @return [void]
|
76
|
-
def dispatch_criteria_to_providers(criteria_name, entity
|
76
|
+
def dispatch_criteria_to_providers(criteria_name, entity)
|
77
|
+
_primary_record = nil
|
78
|
+
|
77
79
|
attributes_walker(entity) do |provider_name, source_class, attributes|
|
78
|
-
|
79
|
-
|
80
|
-
|
80
|
+
attributes.classify { |attr| attr.options[:via] }.each do |via, attrs|
|
81
|
+
record = data_mapper.provider(provider_name).build_criteria(
|
82
|
+
criteria_name,
|
83
|
+
source_class,
|
84
|
+
entity,
|
85
|
+
attrs,
|
86
|
+
:via => via,
|
87
|
+
:primary_record => _primary_record
|
88
|
+
)
|
89
|
+
|
90
|
+
_primary_record ||= record
|
91
|
+
end
|
81
92
|
end
|
82
93
|
end
|
83
94
|
|
data/lib/datamappify/version.rb
CHANGED
@@ -5,8 +5,7 @@ describe Datamappify::Entity do
|
|
5
5
|
Computer.new({
|
6
6
|
:brand => 'Fruit',
|
7
7
|
:cpu => '286',
|
8
|
-
:ram =>
|
9
|
-
:hdd => 65536,
|
8
|
+
:ram => 4242,
|
10
9
|
:gfx => 'Voodoo',
|
11
10
|
:vendor => 'Compaq',
|
12
11
|
:software_os => 'OS X',
|
@@ -22,8 +21,9 @@ describe Datamappify::Entity do
|
|
22
21
|
})
|
23
22
|
end
|
24
23
|
|
24
|
+
its(:brand) { should == 'Fruit' }
|
25
25
|
its(:cpu) { should == '286' }
|
26
|
-
its(:ram) { should ==
|
26
|
+
its(:ram) { should == 4242 }
|
27
27
|
its(:hdd) { should == 65536 }
|
28
28
|
its(:gfx) { should == 'Voodoo' }
|
29
29
|
its(:vendor) { should == 'Compaq' }
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
shared_examples_for "reverse mapped" do |data_provider|
|
4
|
+
let!(:author_repository) { "AuthorRepository#{data_provider}".constantize }
|
5
|
+
let!(:post_repository) { "PostRepository#{data_provider}".constantize }
|
6
|
+
let(:new_author) { Author.new(:name => 'George R. R. Martin', :bio => 'GoT') }
|
7
|
+
let(:new_post) { Post.new(:title => 'Hello world', :author_name => 'Fred Wu', :author_bio => 'x')}
|
8
|
+
let(:new_post_2) { Post.new(:title => 'Hello earth', :author_name => 'Sheldon Cooper', :author_bio => 'y')}
|
9
|
+
|
10
|
+
context "#{data_provider}" do
|
11
|
+
before do
|
12
|
+
author_repository.save!(new_author)
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "persistence" do
|
16
|
+
before do
|
17
|
+
post_repository.save!(new_post_2)
|
18
|
+
end
|
19
|
+
|
20
|
+
describe "referenced entity" do
|
21
|
+
subject { post_repository.save!(new_post) }
|
22
|
+
|
23
|
+
its(:title) { should == 'Hello world' }
|
24
|
+
its(:author_name) { should == 'Fred Wu' }
|
25
|
+
its(:author_bio) { should == 'x' }
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "new found entity" do
|
29
|
+
let!(:saved_post) { post_repository.save!(new_post) }
|
30
|
+
let!(:saved_post_2) { post_repository.save!(new_post_2) }
|
31
|
+
|
32
|
+
context "record 1" do
|
33
|
+
subject { post_repository.find(saved_post.id) }
|
34
|
+
|
35
|
+
its(:title) { should == 'Hello world' }
|
36
|
+
its(:author_name) { should == 'Fred Wu' }
|
37
|
+
its(:author_bio) { should == 'x' }
|
38
|
+
end
|
39
|
+
|
40
|
+
context "record 2" do
|
41
|
+
subject { post_repository.find(saved_post_2.id) }
|
42
|
+
|
43
|
+
its(:title) { should == 'Hello earth' }
|
44
|
+
its(:author_name) { should == 'Sheldon Cooper' }
|
45
|
+
its(:author_bio) { should == 'y' }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe Datamappify::Repository do
|
53
|
+
DATA_PROVIDERS.each do |data_provider|
|
54
|
+
it_behaves_like "reverse mapped", data_provider
|
55
|
+
end
|
56
|
+
end
|
@@ -2,8 +2,8 @@ class ComputerHardware
|
|
2
2
|
include Datamappify::Entity
|
3
3
|
|
4
4
|
attribute :cpu, String
|
5
|
-
attribute :ram, Integer
|
6
|
-
attribute :hdd, Integer
|
5
|
+
attribute :ram, Integer, :default => 8192
|
6
|
+
attribute :hdd, Integer, :default => 65536
|
7
7
|
attribute :gfx, String
|
8
8
|
attribute :vendor, String
|
9
9
|
|
@@ -63,5 +63,18 @@ ActiveRecord::Migration.suppress_messages do
|
|
63
63
|
t.belongs_to :user
|
64
64
|
t.timestamps
|
65
65
|
end
|
66
|
+
|
67
|
+
create_table :posts do |t|
|
68
|
+
t.string :title
|
69
|
+
t.references :author
|
70
|
+
t.timestamps
|
71
|
+
end
|
72
|
+
|
73
|
+
create_table :authors do |t|
|
74
|
+
t.string :name
|
75
|
+
t.string :bio
|
76
|
+
t.references :post
|
77
|
+
t.timestamps
|
78
|
+
end
|
66
79
|
end
|
67
80
|
end
|
@@ -76,3 +76,20 @@ DB.create_table :user_health_cares do
|
|
76
76
|
DateTime :created_at
|
77
77
|
DateTime :updated_at
|
78
78
|
end
|
79
|
+
|
80
|
+
DB.create_table :posts do |t|
|
81
|
+
primary_key :id
|
82
|
+
String :title
|
83
|
+
foreign_key :author_id
|
84
|
+
DateTime :created_at
|
85
|
+
DateTime :updated_at
|
86
|
+
end
|
87
|
+
|
88
|
+
DB.create_table :authors do |t|
|
89
|
+
primary_key :id
|
90
|
+
String :name
|
91
|
+
String :bio
|
92
|
+
String :post_id
|
93
|
+
DateTime :created_at
|
94
|
+
DateTime :updated_at
|
95
|
+
end
|
@@ -5,7 +5,7 @@ module Datamappify::Entity
|
|
5
5
|
class FarDistantEntity
|
6
6
|
include Datamappify::Entity
|
7
7
|
|
8
|
-
attribute :far_distant_attribute_one
|
8
|
+
attribute :far_distant_attribute_one, String
|
9
9
|
end
|
10
10
|
|
11
11
|
class DistantEntity
|
@@ -47,6 +47,8 @@ module Datamappify::Entity
|
|
47
47
|
its(:attributes) { should have_key(:other_distant_attribute_one) }
|
48
48
|
its(:attributes) { should have_key(:other_distant_attribute_two) }
|
49
49
|
its(:attributes) { should have_key(:other_far_far_distant_attribute_one) }
|
50
|
+
its(:attributes) { should have_key(:other_distant_entity_id) }
|
51
|
+
its(:attributes) { should have_key(:other_far_distant_entity_id) }
|
50
52
|
|
51
53
|
its(:attributes) { should_not have_key(:attribute_one) }
|
52
54
|
its(:attributes) { should_not have_key(:attribute_two) }
|
@@ -54,9 +56,7 @@ module Datamappify::Entity
|
|
54
56
|
its(:attributes) { should_not have_key(:distant_attribute_two) }
|
55
57
|
|
56
58
|
its(:attributes) { should_not have_key(:distant_entity_id) }
|
57
|
-
its(:attributes) { should_not have_key(:other_distant_entity_id) }
|
58
59
|
its(:attributes) { should_not have_key(:far_distant_entity_id) }
|
59
|
-
its(:attributes) { should_not have_key(:other_far_distant_entity_id) }
|
60
60
|
its(:attributes) { should_not have_key(:far_far_distant_entity_id) }
|
61
61
|
|
62
62
|
its(:other_attribute_one) { should == 'Hello' }
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datamappify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.52.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fred Wu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.0.0.beta0
|
20
|
+
- - <=
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
22
|
+
version: '2.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.0.0.beta0
|
30
|
+
- - <=
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0
|
32
|
+
version: '2.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: activemodel
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -246,7 +252,8 @@ dependencies:
|
|
246
252
|
- - ~>
|
247
253
|
- !ruby/object:Gem::Version
|
248
254
|
version: 1.0.1
|
249
|
-
description: Compose and manage domain logic and data persistence separately
|
255
|
+
description: Compose, decouple and manage domain logic and data persistence separately.
|
256
|
+
Works great with forms!
|
250
257
|
email:
|
251
258
|
- ifredwu@gmail.com
|
252
259
|
executables: []
|
@@ -275,6 +282,8 @@ files:
|
|
275
282
|
- lib/datamappify/data/criteria/active_record/save_by_key.rb
|
276
283
|
- lib/datamappify/data/criteria/active_record/transaction.rb
|
277
284
|
- lib/datamappify/data/criteria/common.rb
|
285
|
+
- lib/datamappify/data/criteria/concerns/update_primary_record.rb
|
286
|
+
- lib/datamappify/data/criteria/relational/concerns/set_criteria.rb
|
278
287
|
- lib/datamappify/data/criteria/relational/count.rb
|
279
288
|
- lib/datamappify/data/criteria/relational/find.rb
|
280
289
|
- lib/datamappify/data/criteria/relational/find_by_key.rb
|
@@ -301,6 +310,9 @@ files:
|
|
301
310
|
- lib/datamappify/entity.rb
|
302
311
|
- lib/datamappify/entity/active_model/compatibility.rb
|
303
312
|
- lib/datamappify/entity/composable.rb
|
313
|
+
- lib/datamappify/entity/composable/attribute.rb
|
314
|
+
- lib/datamappify/entity/composable/attributes.rb
|
315
|
+
- lib/datamappify/entity/composable/validators.rb
|
304
316
|
- lib/datamappify/entity/lazy_checking.rb
|
305
317
|
- lib/datamappify/entity/relation.rb
|
306
318
|
- lib/datamappify/lazy.rb
|
@@ -338,30 +350,37 @@ files:
|
|
338
350
|
- spec/repository/dirty_tracking_spec.rb
|
339
351
|
- spec/repository/finders_spec.rb
|
340
352
|
- spec/repository/persistence_spec.rb
|
353
|
+
- spec/repository/reverse_mapped_spec.rb
|
341
354
|
- spec/repository/transactions_spec.rb
|
342
355
|
- spec/repository/validation_spec.rb
|
343
356
|
- spec/repository_spec.rb
|
344
357
|
- spec/spec_helper.rb
|
345
358
|
- spec/support/entities/admin_user.rb
|
359
|
+
- spec/support/entities/author.rb
|
346
360
|
- spec/support/entities/comment.rb
|
347
361
|
- spec/support/entities/computer.rb
|
348
362
|
- spec/support/entities/computer_hardware.rb
|
349
363
|
- spec/support/entities/computer_software.rb
|
350
364
|
- spec/support/entities/group.rb
|
351
365
|
- spec/support/entities/hero_user.rb
|
366
|
+
- spec/support/entities/post.rb
|
352
367
|
- spec/support/entities/role.rb
|
353
368
|
- spec/support/entities/user.rb
|
354
369
|
- spec/support/monkey_patches/database_cleaner.rb
|
355
370
|
- spec/support/repositories/active_record/admin_user_repository.rb
|
371
|
+
- spec/support/repositories/active_record/author_repository.rb
|
356
372
|
- spec/support/repositories/active_record/comment_repository.rb
|
357
373
|
- spec/support/repositories/active_record/group_repository.rb
|
374
|
+
- spec/support/repositories/active_record/post_repository.rb
|
358
375
|
- spec/support/repositories/active_record/role_repository.rb
|
359
376
|
- spec/support/repositories/active_record/user_repository.rb
|
360
377
|
- spec/support/repositories/callbacks_chaining_repository.rb
|
361
378
|
- spec/support/repositories/hero_user_repository.rb
|
362
379
|
- spec/support/repositories/sequel/admin_user_repository.rb
|
380
|
+
- spec/support/repositories/sequel/author_repository.rb
|
363
381
|
- spec/support/repositories/sequel/comment_repository.rb
|
364
382
|
- spec/support/repositories/sequel/group_repository.rb
|
383
|
+
- spec/support/repositories/sequel/post_repository.rb
|
365
384
|
- spec/support/repositories/sequel/role_repository.rb
|
366
385
|
- spec/support/repositories/sequel/user_repository.rb
|
367
386
|
- spec/support/shared/contexts.rb
|
@@ -393,7 +412,8 @@ rubyforge_project:
|
|
393
412
|
rubygems_version: 2.0.3
|
394
413
|
signing_key:
|
395
414
|
specification_version: 4
|
396
|
-
summary: Compose and manage domain logic and data persistence separately
|
415
|
+
summary: Compose, decouple and manage domain logic and data persistence separately.
|
416
|
+
Works great with forms!
|
397
417
|
test_files:
|
398
418
|
- spec/entity/composable_spec.rb
|
399
419
|
- spec/entity/inheritance_spec.rb
|
@@ -405,30 +425,37 @@ test_files:
|
|
405
425
|
- spec/repository/dirty_tracking_spec.rb
|
406
426
|
- spec/repository/finders_spec.rb
|
407
427
|
- spec/repository/persistence_spec.rb
|
428
|
+
- spec/repository/reverse_mapped_spec.rb
|
408
429
|
- spec/repository/transactions_spec.rb
|
409
430
|
- spec/repository/validation_spec.rb
|
410
431
|
- spec/repository_spec.rb
|
411
432
|
- spec/spec_helper.rb
|
412
433
|
- spec/support/entities/admin_user.rb
|
434
|
+
- spec/support/entities/author.rb
|
413
435
|
- spec/support/entities/comment.rb
|
414
436
|
- spec/support/entities/computer.rb
|
415
437
|
- spec/support/entities/computer_hardware.rb
|
416
438
|
- spec/support/entities/computer_software.rb
|
417
439
|
- spec/support/entities/group.rb
|
418
440
|
- spec/support/entities/hero_user.rb
|
441
|
+
- spec/support/entities/post.rb
|
419
442
|
- spec/support/entities/role.rb
|
420
443
|
- spec/support/entities/user.rb
|
421
444
|
- spec/support/monkey_patches/database_cleaner.rb
|
422
445
|
- spec/support/repositories/active_record/admin_user_repository.rb
|
446
|
+
- spec/support/repositories/active_record/author_repository.rb
|
423
447
|
- spec/support/repositories/active_record/comment_repository.rb
|
424
448
|
- spec/support/repositories/active_record/group_repository.rb
|
449
|
+
- spec/support/repositories/active_record/post_repository.rb
|
425
450
|
- spec/support/repositories/active_record/role_repository.rb
|
426
451
|
- spec/support/repositories/active_record/user_repository.rb
|
427
452
|
- spec/support/repositories/callbacks_chaining_repository.rb
|
428
453
|
- spec/support/repositories/hero_user_repository.rb
|
429
454
|
- spec/support/repositories/sequel/admin_user_repository.rb
|
455
|
+
- spec/support/repositories/sequel/author_repository.rb
|
430
456
|
- spec/support/repositories/sequel/comment_repository.rb
|
431
457
|
- spec/support/repositories/sequel/group_repository.rb
|
458
|
+
- spec/support/repositories/sequel/post_repository.rb
|
432
459
|
- spec/support/repositories/sequel/role_repository.rb
|
433
460
|
- spec/support/repositories/sequel/user_repository.rb
|
434
461
|
- spec/support/shared/contexts.rb
|