wherever-positions 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -7,7 +7,7 @@ class Wherever
7
7
  define_method "set_#{name}" do |version, values|
8
8
  new_version?(name, version)
9
9
  lookup_class.create(:name => version, :values => key_to_string(values))
10
- recalculate if set_price_lookup(name, version)
10
+ recalculate(name) if set_price_lookup(name, version)
11
11
  end
12
12
  end
13
13
 
@@ -36,20 +36,36 @@ class Wherever
36
36
  lookup.save
37
37
  end
38
38
 
39
- def recalculate
39
+ def recalculate(name)
40
+ keys = get_lookup(name).keys
40
41
  config.key_groups.each do |group|
41
- get_key_store(*group).datasets.delete_all
42
+ if keys & group != keys
43
+ get_key_store(*group).datasets.delete_all
44
+ end
42
45
  end
43
46
 
44
47
  identifier_set.datasets.all.each do |record|
45
48
  @grouping.call(record.values, nil, record, config.keys)
46
49
  record.save!
47
50
  config.key_groups.each do |group|
48
- for_group(group, record.values, record)
51
+ if keys & group != keys
52
+ for_group(group, record.values, record)
53
+ end
54
+ end
55
+ end
56
+ config.key_groups.each do |group|
57
+ if keys & group == keys
58
+ get_key_store(*group).datasets.all.each do |record|
59
+ @grouping.call(record.values, nil, record, nil)
60
+ end
61
+ record.save!
49
62
  end
50
63
  end
51
64
  end
52
65
 
66
+ def temp(group_keys, values, id_record)
67
+ end
68
+
53
69
  def get_lookup_record(name, marker)
54
70
  lookup = get_lookup(name)
55
71
  return [lookup, lookup.versions.find_or_create_by(:name => lookup.lookups[marker])]
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wherever-positions}
8
- s.version = "0.4.0"
8
+ s.version = "0.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David Henry"]
12
- s.date = %q{2011-11-02}
12
+ s.date = %q{2011-11-03}
13
13
  s.description = %q{Allow Store of positions by multiple keys with teh option to mark specific points in time for use later}
14
14
  s.email = %q{dw_henry@yahoo.com.au}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wherever-positions
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Henry
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-02 00:00:00 +00:00
18
+ date: 2011-11-03 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency