platanus 0.0.28 → 0.0.29

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,14 +37,16 @@ module Platanus
37
37
  elsif self.column_names.include? "#{top_value_prop}_id"
38
38
  belongs_to top_value_prop.to_sym, class_name: tname_class
39
39
  else
40
+ instance_var = "@_last_#{tname_single}".to_sym
40
41
  send :define_method, top_value_prop do
41
42
  # Storing the last stacked value will not prevent race conditions
42
43
  # when simultaneous updates occur.
43
- return @_stacked_last unless @_stacked_last.nil?
44
- @_stacked_last = self.send(tname).first
44
+ last = instance_variable_get instance_var
45
+ return last unless last.nil?
46
+ instance_variable_set(instance_var, self.send(tname).first)
45
47
  end
46
48
  send :define_method, "#{top_value_prop}=" do |_top|
47
- @_stacked_last = _top
49
+ instance_variable_set(instance_var, _top)
48
50
  end
49
51
  end
50
52
  send :private, "#{top_value_prop}="
@@ -1,3 +1,3 @@
1
1
  module Platanus
2
- VERSION = "0.0.28" # 0.1 will come with tests!
2
+ VERSION = "0.0.29" # 0.1 will come with tests!
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: platanus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.28
4
+ version: 0.0.29
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-26 00:00:00.000000000 Z
12
+ date: 2012-10-29 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Platan.us utility gem
15
15
  email: