mongoid_feature_flags 0.1.22 → 0.1.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/mongoid_feature_flags.rb +3 -3
  2. metadata +1 -1
@@ -41,7 +41,7 @@ module Mongoid
41
41
  end
42
42
 
43
43
  def features
44
- inherited_feature_flags.merge(self.feature_flags)
44
+ (inherited_feature_flags || {}).merge(self.feature_flags || {})
45
45
  end
46
46
 
47
47
  def feature?(*required_features, &block)
@@ -65,8 +65,8 @@ module Mongoid
65
65
  def inherited_feature_flags
66
66
  if self.class.instance_variable_defined?("@feature_flag_parents")
67
67
  self.class.instance_variable_get("@feature_flag_parents").inject({}) do |flag_hash, relative|
68
- if self.respond_to?(relative) && self.send(relative).present? && self.send(relative).respond_to?(:feature_flags)
69
- flag_hash.merge(self.send(relative).send(:feature_flags))
68
+ if self.respond_to?(relative) && self.send(relative).present? && self.send(relative).respond_to?(:features)
69
+ flag_hash.merge(self.send(relative).send(:features) || {})
70
70
  else
71
71
  flag_hash
72
72
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_feature_flags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.1.25
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: