activerecord-metal 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,16 +37,16 @@ module ActiveRecord::Metal::Postgresql
37
37
  ask "SELECT 't'::BOOLEAN FROM pg_indexes WHERE indexname=$1", name
38
38
  end
39
39
 
40
- def columns
40
+ def columns(table_name)
41
41
  columns = exec("SELECT attname FROM pg_attribute , pg_type WHERE typrelid=attrelid AND typname=$1", table_name).map(&:first)
42
42
 
43
43
  columns -= %w(tableoid cmax xmax cmin xmin ctid oid)
44
44
  columns.select { |column| column !~ /^\.\.\.\.\.\.\.\.pg\.dropped/ }
45
45
  end
46
46
 
47
- def has_column?(name)
47
+ def has_column?(table_name, name)
48
48
  expect! name => String
49
- columns.include?(name)
49
+ columns(table_name).include?(name)
50
50
  end
51
51
  end
52
52
 
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord; end
2
2
 
3
3
  class ActiveRecord::Metal
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-metal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -64,7 +64,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
64
64
  version: '0'
65
65
  segments:
66
66
  - 0
67
- hash: 522954634217002101
67
+ hash: 2358583121152594136
68
68
  required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  none: false
70
70
  requirements: