zuul 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58d203aaa4eca804ec402bbd10742127e45b0607
4
- data.tar.gz: 53c92c3fd32d310492026b5012603cd57c7fd458
3
+ metadata.gz: b98d35feba741249f26d2700e815d15f0f87c969
4
+ data.tar.gz: ea24b63238871dfd1ea1f2382dc9d1df48a97449
5
5
  SHA512:
6
- metadata.gz: 4400d89b4ce82f09b6b1ac148febb141c1b98801b7784f4d395b0aa9b2fc788860cef0b935a91ea61c503fc6b095d91ca3c188c32fcc2222deb8afc4cabd6322
7
- data.tar.gz: d24b6237c95fabf90e608a523b724e07b3c8d1acbd7ffa0d4b4ff37a7fe9752536d4bdb182940c72fa96b7767f08a59625e304becfed027b2f1ea16ba7edc056
6
+ metadata.gz: dea4199f801fa7a2463af0872d4b2367c5bd4491ff2b379b7127f785b58b2c1844c966d1d1e52520c3b7f626a6e1bf56b51f61ccbd013187086057ae53d1be18
7
+ data.tar.gz: 60b3ef6d9d0b7444af7f6cae06401e280904d77c38cd7683476713ad370b0e619afc57d164645997aadb9810da0f1be289c485ad54a142db545480d65504a779
@@ -70,7 +70,13 @@ module Zuul
70
70
  class_eval do
71
71
  # def CLASS_TYPE_foreign_key
72
72
  define_method "#{class_type_name}_foreign_key" do
73
- "#{send("#{class_type_name}_table_name").singularize}_#{send("#{class_type_name}_class").primary_key}"
73
+ # This is hideous, but we need some sort of fallback for cases like Rails 4 Heroku deploys where the environment and
74
+ # database are not available.
75
+ begin
76
+ "#{send("#{class_type_name}_table_name").singularize}_#{send("#{class_type_name}_class").primary_key}"
77
+ rescue
78
+ "#{send("#{class_type_name}_table_name").singularize}_id"
79
+ end
74
80
  end
75
81
  alias_method "#{class_type.to_s.gsub(/_class$/,"").pluralize}_foreign_key", "#{class_type.to_s.gsub(/_class$/,"").singularize}_foreign_key"
76
82
 
data/lib/zuul/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Zuul
2
- VERSION = '0.2.6'
2
+ VERSION = '0.2.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuul
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rebec
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-27 00:00:00.000000000 Z
11
+ date: 2013-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport