sequel_dm 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 44a6ec9f89b463d1d49304d69514a76108579e85
4
+ data.tar.gz: 93b4891878c86f5c165e722fd36d02ef23f10fe8
5
+ SHA512:
6
+ metadata.gz: 1efa9c0668559b207aa9b19a6fdad27c8530274897bcd0debf0ac993321f62b5d6aa3a655441b4975ee84e8280ec8329c349d6302b7ee32ee9e1afd6b51a1043
7
+ data.tar.gz: 0d4e5c05333eb51ed9b575db63eca2cf7ea2a4ef778d1acc5d8304670e3f5b090803dcdf58ef2dd6cfda14fae52670ccff03468e8ab96e09eed94044a66df39b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sequel_dm (0.0.2)
4
+ sequel_dm (0.0.3)
5
5
  activesupport
6
6
  sequel (~> 4.6)
7
7
 
data/lib/sequel_dm/dao.rb CHANGED
@@ -84,6 +84,12 @@ module SequelDM
84
84
  super
85
85
  end
86
86
 
87
+ def associate(type, name, opts = OPTS, &block)
88
+ super.tap do
89
+ set_dataset(eager(name))
90
+ end
91
+ end
92
+
87
93
  def set_dataset_row_proc(ds)
88
94
  ds.row_proc = Proc.new do |raw|
89
95
  raise StandardError, "Mapper should be specified" if !self.mapper
@@ -248,6 +254,9 @@ module SequelDM
248
254
  def insert_associations(entity)
249
255
  unless association_reflections.empty?
250
256
  association_reflections.each do |association_name, options|
257
+ if options[:if] && !options[:if].call(entity)
258
+ next
259
+ end
251
260
  association_dao = options[:class]
252
261
  if entity.respond_to?(association_name)
253
262
  children = association_dao.insert_all(entity.send(association_name), entity)
@@ -1,3 +1,3 @@
1
1
  module SequelDM
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel_dm
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.0.2
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Albert Gazizov
@@ -10,72 +9,64 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2014-04-08 00:00:00.000000000 Z
12
+ date: 2014-10-30 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
- prerelease: false
17
15
  name: activesupport
18
- type: :runtime
19
- version_requirements: !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
20
17
  requirements:
21
- - - ! '>='
18
+ - - ">="
22
19
  - !ruby/object:Gem::Version
23
20
  version: '0'
24
- none: false
25
- requirement: !ruby/object:Gem::Requirement
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
26
24
  requirements:
27
- - - ! '>='
25
+ - - ">="
28
26
  - !ruby/object:Gem::Version
29
27
  version: '0'
30
- none: false
31
28
  - !ruby/object:Gem::Dependency
32
- prerelease: false
33
29
  name: bundler
34
- type: :development
35
- version_requirements: !ruby/object:Gem::Requirement
30
+ requirement: !ruby/object:Gem::Requirement
36
31
  requirements:
37
- - - ~>
32
+ - - "~>"
38
33
  - !ruby/object:Gem::Version
39
34
  version: '1.3'
40
- none: false
41
- requirement: !ruby/object:Gem::Requirement
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
42
38
  requirements:
43
- - - ~>
39
+ - - "~>"
44
40
  - !ruby/object:Gem::Version
45
41
  version: '1.3'
46
- none: false
47
42
  - !ruby/object:Gem::Dependency
48
- prerelease: false
49
43
  name: rake
50
- type: :development
51
- version_requirements: !ruby/object:Gem::Requirement
44
+ requirement: !ruby/object:Gem::Requirement
52
45
  requirements:
53
- - - ! '>='
46
+ - - ">="
54
47
  - !ruby/object:Gem::Version
55
48
  version: '0'
56
- none: false
57
- requirement: !ruby/object:Gem::Requirement
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
58
52
  requirements:
59
- - - ! '>='
53
+ - - ">="
60
54
  - !ruby/object:Gem::Version
61
55
  version: '0'
62
- none: false
63
56
  - !ruby/object:Gem::Dependency
64
- prerelease: false
65
57
  name: sequel
66
- type: :runtime
67
- version_requirements: !ruby/object:Gem::Requirement
58
+ requirement: !ruby/object:Gem::Requirement
68
59
  requirements:
69
- - - ~>
60
+ - - "~>"
70
61
  - !ruby/object:Gem::Version
71
62
  version: '4.6'
72
- none: false
73
- requirement: !ruby/object:Gem::Requirement
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
74
66
  requirements:
75
- - - ~>
67
+ - - "~>"
76
68
  - !ruby/object:Gem::Version
77
69
  version: '4.6'
78
- none: false
79
70
  description: Sequel based Data Mapper implementation
80
71
  email:
81
72
  - deeper4k@gmail.com
@@ -84,8 +75,8 @@ executables: []
84
75
  extensions: []
85
76
  extra_rdoc_files: []
86
77
  files:
87
- - .gitignore
88
- - .travis.yml
78
+ - ".gitignore"
79
+ - ".travis.yml"
89
80
  - Gemfile
90
81
  - Gemfile.lock
91
82
  - LICENSE.txt
@@ -105,33 +96,26 @@ files:
105
96
  homepage: http://github.com/deeper4k/sequel_dm
106
97
  licenses:
107
98
  - MIT
99
+ metadata: {}
108
100
  post_install_message:
109
101
  rdoc_options: []
110
102
  require_paths:
111
103
  - lib
112
104
  required_ruby_version: !ruby/object:Gem::Requirement
113
105
  requirements:
114
- - - ! '>='
106
+ - - ">="
115
107
  - !ruby/object:Gem::Version
116
- segments:
117
- - 0
118
- hash: -3775447022657045354
119
108
  version: '0'
120
- none: false
121
109
  required_rubygems_version: !ruby/object:Gem::Requirement
122
110
  requirements:
123
- - - ! '>='
111
+ - - ">="
124
112
  - !ruby/object:Gem::Version
125
- segments:
126
- - 0
127
- hash: -3775447022657045354
128
113
  version: '0'
129
- none: false
130
114
  requirements: []
131
115
  rubyforge_project:
132
- rubygems_version: 1.8.23
116
+ rubygems_version: 2.2.2
133
117
  signing_key:
134
- specification_version: 3
118
+ specification_version: 4
135
119
  summary: Sequel based Data Mapper implementation
136
120
  test_files:
137
121
  - spec/sequel_dm/dao_spec.rb