mcfly 0.0.18 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -6
- data/lib/mcfly/constraint.sql +5 -0
- data/lib/mcfly/migration.rb +5 -5
- data/lib/mcfly/version.rb +1 -1
- data/spec/dummy/spec +1 -0
- data/spec/model_spec.rb +20 -16
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5a2ed94848d3460cbf727f542510f3ad70b7a16
|
4
|
+
data.tar.gz: cc1960246aca8ba7b598b0188c1ed739adb0addc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fa0d0b71637f7d32d69bf3769e0d26c0683d2d1599dbd37771e4bc840ff14627ae8adf64258bdb00f7ecb8d3318b24109b8682816cbba0dca617bc93ef47622
|
7
|
+
data.tar.gz: 0bdd70da17caffe1b5648bc2b4895791bfef573a1d9a18e86410dafeeab8cc53ae0f2cf3901b0e66c34c8156bd8c95730efbb1f5c0112136c17fc4f343236739
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mcfly (0.0.
|
4
|
+
mcfly (0.0.19)
|
5
5
|
delorean_lang (~> 0.1)
|
6
6
|
pg (~> 0.17)
|
7
7
|
|
@@ -34,9 +34,9 @@ GEM
|
|
34
34
|
minitest (~> 5.1)
|
35
35
|
thread_safe (~> 0.3, >= 0.3.4)
|
36
36
|
tzinfo (~> 1.1)
|
37
|
-
arel (6.0.
|
37
|
+
arel (6.0.4)
|
38
38
|
builder (3.2.2)
|
39
|
-
delorean_lang (0.3.
|
39
|
+
delorean_lang (0.3.22)
|
40
40
|
activerecord (>= 3.2)
|
41
41
|
treetop (~> 1.5)
|
42
42
|
diff-lcs (1.2.5)
|
@@ -49,7 +49,7 @@ GEM
|
|
49
49
|
minitest (5.8.1)
|
50
50
|
nokogiri (1.6.6.2)
|
51
51
|
mini_portile (~> 0.6.0)
|
52
|
-
pg (0.
|
52
|
+
pg (0.19.0)
|
53
53
|
polyglot (0.3.5)
|
54
54
|
rack (1.6.4)
|
55
55
|
rack-test (0.6.3)
|
@@ -85,7 +85,7 @@ GEM
|
|
85
85
|
rspec-mocks (~> 2.99.0)
|
86
86
|
thor (0.19.1)
|
87
87
|
thread_safe (0.3.5)
|
88
|
-
treetop (1.6.
|
88
|
+
treetop (1.6.8)
|
89
89
|
polyglot (~> 0.3)
|
90
90
|
tzinfo (1.2.2)
|
91
91
|
thread_safe (~> 0.1)
|
@@ -98,4 +98,4 @@ DEPENDENCIES
|
|
98
98
|
rspec-rails (~> 2.99)
|
99
99
|
|
100
100
|
BUNDLED WITH
|
101
|
-
1.
|
101
|
+
1.13.6
|
data/lib/mcfly/constraint.sql
CHANGED
@@ -2,3 +2,8 @@
|
|
2
2
|
-- not infinity (i.e. object is obsoleted).
|
3
3
|
ALTER TABLE "%{table}" ADD CONSTRAINT check_o_user
|
4
4
|
CHECK ((obsoleted_dt = 'Infinity') = (o_user_id IS NULL));
|
5
|
+
|
6
|
+
-- obsoleted_dt > created_dt should be enforced -- however, there are
|
7
|
+
-- many instances of obsoleted_dt=created_dt in our existing apps.
|
8
|
+
ALTER TABLE "%{table}" ADD CONSTRAINT check_bad_obsolete
|
9
|
+
CHECK (obsoleted_dt >= created_dt);
|
data/lib/mcfly/migration.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
class McflyMigration < ActiveRecord::Migration
|
2
2
|
INSERT_TRIG, UPDATE_TRIG, UPDATE_APPEND_ONLY_TRIG, DELETE_TRIG, CONSTRAINT =
|
3
3
|
%w{
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
insert_trig
|
5
|
+
update_trig
|
6
|
+
update_append_only_trig
|
7
|
+
delete_trig
|
8
|
+
constraint
|
9
9
|
}.map { |f|
|
10
10
|
File.read(File.dirname(__FILE__) + "/#{f}.sql")
|
11
11
|
}
|
data/lib/mcfly/version.rb
CHANGED
data/spec/dummy/spec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
../../spec/
|
data/spec/model_spec.rb
CHANGED
@@ -9,19 +9,19 @@ describe "Mcfly" do
|
|
9
9
|
@dts = ['2001-01-01', '2001-01-05', '2001-01-10']
|
10
10
|
|
11
11
|
@sis = [
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
12
|
+
["FN Fix-30 MBS", "A"],
|
13
|
+
["FN Fix-30 Cash", "A"],
|
14
|
+
["FN Fix-30 MBS Blend", "A"],
|
15
|
+
["FN Fix-30 HB MBS", "A"],
|
16
|
+
["FN Fix-15 MBS", "B"],
|
17
|
+
["FN Fix-15 Cash", "B"],
|
18
|
+
["FN Fix-15 HB MBS", "B"],
|
19
|
+
["FN Fix-15 HB Cash", "B"],
|
20
|
+
["FN ARM 3/1 LIBOR", "D"],
|
21
|
+
["FN ARM 3/1 LIBOR Cash", "D"],
|
22
|
+
["FN ARM 5/1 LIBOR", "D"],
|
23
|
+
["FN ARM 5/1 LIBOR Cash", "D"],
|
24
|
+
]
|
25
25
|
|
26
26
|
@sis.each_with_index { |(name, sc), i|
|
27
27
|
si = SecurityInstrument.new(name: name, settlement_class: sc)
|
@@ -226,14 +226,18 @@ describe "Mcfly" do
|
|
226
226
|
mp = MarketPrice.lookup_si('infinity', si)
|
227
227
|
mp.user_id.should == 20
|
228
228
|
mp.o_user_id.should == nil
|
229
|
+
end
|
229
230
|
|
230
|
-
|
231
|
+
it "should set o_user on delete" do
|
232
|
+
si = SecurityInstrument.find_by_name("FN Fix-15 HB MBS")
|
233
|
+
mp = MarketPrice.lookup_si('infinity', si)
|
234
|
+
mp.obsoleted_dt.should == Float::INFINITY
|
235
|
+
mp.o_user_id.should == nil
|
231
236
|
|
237
|
+
rid = mp.id
|
232
238
|
Mcfly.whodunnit = {id: 30}
|
233
|
-
|
234
239
|
mp.delete
|
235
240
|
mp = MarketPrice.find(rid)
|
236
241
|
mp.o_user_id.should == 30
|
237
242
|
end
|
238
|
-
|
239
243
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mcfly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arman Bostani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- spec/dummy/public/500.html
|
117
117
|
- spec/dummy/public/favicon.ico
|
118
118
|
- spec/dummy/script/rails
|
119
|
+
- spec/dummy/spec
|
119
120
|
- spec/model_spec.rb
|
120
121
|
- spec/no_trans_spec.rb
|
121
122
|
- spec/spec_helper.rb
|
@@ -139,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
140
|
version: '0'
|
140
141
|
requirements: []
|
141
142
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.
|
143
|
+
rubygems_version: 2.5.2
|
143
144
|
signing_key:
|
144
145
|
specification_version: 4
|
145
146
|
summary: A database table versioning system.
|