ggoodale-attr_private 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. data/lib/attr_private.rb +7 -1
  2. metadata +2 -2
data/lib/attr_private.rb CHANGED
@@ -18,7 +18,13 @@ module AttrPrivate
18
18
  extend ClassMethods
19
19
 
20
20
  fields.each {|field|
21
- column = connection.columns(table_name, "AttrPrivate").detect{|column| column.name.to_sym == field.to_sym}
21
+ begin
22
+ column = connection.columns(table_name, "AttrPrivate").detect{|column| column.name.to_sym == field.to_sym}
23
+ rescue => e
24
+ # If an error occurs looking up the column, we're probably in a context where the db isn't populated.
25
+ # Do nothing.
26
+ next
27
+ end
22
28
  raise ActiveRecord::ActiveRecordError, "Unknown field #{field}" if column.nil?
23
29
 
24
30
  puts "protecting #{field}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ggoodale-attr_private
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Goodale
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-08-13 00:00:00 -07:00
12
+ date: 2008-10-09 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15