delegate_associations 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8d6018990f0bca11ec45bf5d679f0843767e34b
4
- data.tar.gz: ef8f54f4de9e9ec11ce9d86cebecd6827d5b8a9b
3
+ metadata.gz: b2e224ffc9bad2b9f1163119098d92148e3d1294
4
+ data.tar.gz: a52e4dc1f43192d06cbad525825686df200aab81
5
5
  SHA512:
6
- metadata.gz: f185c261032f99f6b2b5a82208bc62e12e72fed5b4b370ba9975e56f74f385ec1ea71b109ff2618019b4916a7c2ebc192ec45e64ce737f685468aecd4be562d2
7
- data.tar.gz: 01b0b7e4606a7255d01eebd03e5010be93cbb04dbce27e274254fa750478089d514957d3a48b2ffbe3f9e91b62cea12cfbf135211775523c4af68cd2a7c1773e
6
+ metadata.gz: b32909d78651f7bafe13e4fe9aa893ed7e4743c6b4f3fe86e66fd0e09a4d4876b7b24ab58a159e7ab059be389988423c529503b6e879cdf8d3c575d94b7b1440
7
+ data.tar.gz: 8ac939ccfd9ed790b3e102c055fc94ab0c900fa6406dafb9762a9337a939d01328ca239e88cf1a0c20ccbf2557c4cb7266ba65876ef15732ae7d30362c32717c
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "delegate_associations"
3
- s.version = "0.1.3"
3
+ s.version = "0.1.4"
4
4
  s.description = "A gem for delegate attributes and associations of belongs_to and has_one"
5
5
  s.summary = "A gem for delegate attributes and associations of belongs_to and has_one"
6
6
  s.homepage = "https://github.com/Brunomm/delegate_associations"
@@ -49,12 +49,18 @@ module DelegateAssociations
49
49
  only = [options[:only]].flatten.compact.map!(&:to_sym)
50
50
  except += delegate_exclude_columns
51
51
 
52
- associations.each do |association|
53
- get_deletage_methods(reflect_on_association(association).klass.column_names, except, only).each do |attribute|
54
- options[:suffix].each do |sf|
55
- delegate "#{attribute}#{sf}", to: association, allow_nil: options[:allow_nil]
52
+ # I need "begin" because have a problem with Devise when I run migrations
53
+ # Devise call User classs before run all migrations
54
+ begin
55
+ associations.each do |association|
56
+ get_deletage_methods(reflect_on_association(association).klass.column_names, except, only).each do |attribute|
57
+ options[:suffix].each do |sf|
58
+ delegate "#{attribute}#{sf}", to: association, allow_nil: options[:allow_nil]
59
+ end
56
60
  end
57
61
  end
62
+ rescue
63
+ true
58
64
  end
59
65
  end
60
66
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delegate_associations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno Mucelini Mergen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-12 00:00:00.000000000 Z
11
+ date: 2015-05-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A gem for delegate attributes and associations of belongs_to and has_one
14
14
  email: