inspectar 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Inspectar
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/inspectar.rb CHANGED
@@ -25,6 +25,21 @@ class #{table_data[:model_name]} < ActiveRecord::Base
25
25
  establish_connection "inspectar"
26
26
  self.table_name = '#{table_data[:table_name]}'
27
27
  self.inheritance_column = :_type_disabled
28
+
29
+ def method_missing(method_id, *args)
30
+ hash = {}
31
+
32
+ self.class.column_names.each do |v|
33
+ hash[v] = v
34
+ hash[v.downcase] = v
35
+ end
36
+
37
+ if hash.has_key?(method_id.to_s)
38
+ send hash[method_id.to_s].to_sym
39
+ else
40
+ super
41
+ end
42
+ end
28
43
  end
29
44
  }
30
45
  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.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: