blazer 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of blazer might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16ac494e37f4c14e418e50320667f1b371f05190
4
- data.tar.gz: 8ebadcac25cbbf06a86c16e01d4b17f3f077eac0
3
+ metadata.gz: d74bc946c7e95c76fa9144f6644dd1bb1000d2c7
4
+ data.tar.gz: 2f5b49ff2e8f20986286d08995d78641857b1140
5
5
  SHA512:
6
- metadata.gz: 3437a6d97706f7a7e3b394012f9b17d5b36661fda013966e80c66bc1b279ada234a6c968a4e6f567b4c13ed5946564f581ca4835d247f740b6a08de21d9a88b2
7
- data.tar.gz: d56d5300d8267dcd5f866ce25ce4e40f7e27ffe4659c893b615effd40610ccd7d3326d5fc827ac412d2feb40ddfb4494474e6ca833ad7972038e6d0168309393
6
+ metadata.gz: f5ba9405ba682acaad4b98ae03563c9cd0c489ec35560b856089b453f4f068b400978e3645c1a8812249b5b50edc8bec35fbe1401aeecdcd95bb262f0645cc69
7
+ data.tar.gz: c0254f4a628a20e960f699fb79642213293f447b794a0d1052d8af1c8f686758eb6f2ca79b1f7aa3579e5794902ecf188dcd078e45e1e00441d077055ea98e1e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.3.3
2
+
3
+ - Fixed error with Rails 4.1 and below
4
+
1
5
  ## 1.3.2
2
6
 
3
7
  - Added support for Rails 5
@@ -1,6 +1,6 @@
1
1
  module Blazer
2
2
  class Audit < ActiveRecord::Base
3
- belongs_to :user, class_name: Blazer.user_class.to_s, required: false
4
- belongs_to :query, required: false
3
+ belongs_to :user, Blazer::BELONGS_TO_OPTIONAL.merge(class_name: Blazer.user_class.to_s)
4
+ belongs_to :query, Blazer::BELONGS_TO_OPTIONAL
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Blazer
2
2
  class Query < ActiveRecord::Base
3
- belongs_to :creator, class_name: Blazer.user_class.to_s, required: false if Blazer.user_class
3
+ belongs_to :creator, Blazer::BELONGS_TO_OPTIONAL.merge(class_name: Blazer.user_class.to_s) if Blazer.user_class
4
4
  has_many :checks, dependent: :destroy
5
5
  has_many :dashboard_queries, dependent: :destroy
6
6
  has_many :dashboards, through: :dashboard_queries
data/lib/blazer/engine.rb CHANGED
@@ -22,9 +22,10 @@ module Blazer
22
22
  Blazer.check_schedules = Blazer.settings["check_schedules"] if Blazer.settings.key?("check_schedules")
23
23
 
24
24
  if Blazer.user_class
25
- Blazer::Query.belongs_to :creator, class_name: Blazer.user_class.to_s
26
- Blazer::Dashboard.belongs_to :creator, class_name: Blazer.user_class.to_s
27
- Blazer::Check.belongs_to :creator, class_name: Blazer.user_class.to_s
25
+ options = Blazer::BELONGS_TO_OPTIONAL.merge(class_name: Blazer.user_class.to_s)
26
+ Blazer::Query.belongs_to :creator, options
27
+ Blazer::Dashboard.belongs_to :creator, options
28
+ Blazer::Check.belongs_to :creator, options
28
29
  end
29
30
 
30
31
  Blazer.cache ||= Rails.cache
@@ -1,3 +1,3 @@
1
1
  module Blazer
2
- VERSION = "1.3.2"
2
+ VERSION = "1.3.3"
3
3
  end
data/lib/blazer.rb CHANGED
@@ -30,6 +30,8 @@ module Blazer
30
30
  "cancelled on user's request", # redshift
31
31
  "system requested abort" # redshift
32
32
  ]
33
+ BELONGS_TO_OPTIONAL = {}
34
+ BELONGS_TO_OPTIONAL[:optional] = true if Rails::VERSION::MAJOR >= 5
33
35
 
34
36
  def self.time_zone=(time_zone)
35
37
  @time_zone = time_zone.is_a?(ActiveSupport::TimeZone) ? time_zone : ActiveSupport::TimeZone[time_zone.to_s]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blazer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-07 00:00:00.000000000 Z
11
+ date: 2016-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails