spatten-bookkeeper 0.2.0 → 0.2.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.
@@ -17,11 +17,13 @@ module EnsuresImmutabilityOf
17
17
  configuration.update(attr_names.pop) if attr_names.last.is_a?(Hash)
18
18
 
19
19
  if(attr_names.include? :all)
20
- model_instance = self.new
21
- attr_names = []
22
- attr_names |= self.column_names.reject { |name| !model_instance.respond_to?(name) }
23
- attr_names |= self.reflect_on_all_associations.collect { |a| a.name.to_s }
24
- attr_names |= self.reflect_on_all_aggregations.collect { |a| a.name.to_s }
20
+ begin
21
+ model_instance = self.new
22
+ attr_names = []
23
+ attr_names |= self.column_names.reject { |name| !model_instance.respond_to?(name) }
24
+ attr_names |= self.reflect_on_all_associations.collect { |a| a.name.to_s }
25
+ attr_names |= self.reflect_on_all_aggregations.collect { |a| a.name.to_s }
26
+ rescue ActiveRecord::StatementInvalid; end
25
27
  end
26
28
 
27
29
  attr_names.each do |attr_name|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spatten-bookkeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Luscher