inspectar 0.0.7 → 0.0.8

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.
@@ -28,17 +28,23 @@ class #{table_data[:model_name]} < ActiveRecord::Base
28
28
  self.inheritance_column = :_type_disabled
29
29
 
30
30
  def method_missing(method_id, *args)
31
- hash = {}
31
+ getters = {}
32
+ setters = {}
32
33
 
33
34
  self.class.column_names.each do |v|
34
- hash[v] = v
35
- hash[v.downcase] = v
35
+ getters[v] = v
36
+ getters[v.downcase] = v
36
37
  end
37
38
 
38
- if hash.has_key?(method_id.to_s)
39
- send hash[method_id.to_s].to_sym
40
- elsif hash.has_key?(method_id.to_s + "=")
41
- send (hash[method_id.to_s] + "=").to_sym, args
39
+ self.class.column_names.each do |v|
40
+ setters[v+"="] = v
41
+ setters[v.downcase+"="] = v + "="
42
+ end
43
+
44
+ if getters.has_key?(method_id.to_s)
45
+ send getters[method_id.to_s].to_sym
46
+ elsif setters.has_key?(method_id.to_s)
47
+ send setters[method_id.to_s].to_sym, *args
42
48
  else
43
49
  super
44
50
  end
@@ -1,3 +1,3 @@
1
1
  module Inspectar
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inspectar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: