padma-assets 0.2.7 → 0.2.8

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: 05b65bbe9d792c95ad1dc4c08f0533158d05b75d
4
- data.tar.gz: bf851481a0c2d2f198337758c59ed2e407c94c2d
3
+ metadata.gz: c6c0e4404edbb4641adb4be29c775a4510002c70
4
+ data.tar.gz: c7b33edbea9a3a408280f2a099600595c194fe2c
5
5
  SHA512:
6
- metadata.gz: b1d9b9d9b1f25167ae5663a9596b4ed7ff81950938d52f40fa7fda2ae95c209e612bbed7d1467a03e7b45b7ff65cc88084c84497b90a0034c10245ea26c4789e
7
- data.tar.gz: 195d0ddff2d9653593c55a2a916ab34c5b0f19addb980ff301cfd77d54cdc46701d5284177b430e6a6932b638827ece27af9e8895d268774fe1af7db648f8440
6
+ metadata.gz: 958cbbe5c7e1a584bce3a16877ae789f978cfb33d1ea74ea995fabf702d204341f7ead231a9e91c9b139e22ccb2d1281c3e6e1cb49e9d480c088fd6ee9f61954
7
+ data.tar.gz: 63d3768c45fc19e99b1645de605e7cf36e6428dcf71ff7396bee2e09c6f6b8b4e8048f4ea93117845e5c1d36ee3b2ff0099c226983dfcac7763c896041311066
@@ -21,11 +21,19 @@ class GeneralAbility
21
21
  name = user.current_account.try(:name)
22
22
  if name
23
23
  @country = Rails.cache.fetch("countryfor#{name}") do
24
- user.current_account.padma.country
24
+ padma_account(user).try(:country)
25
25
  end
26
26
  @country == country_name
27
27
  end
28
28
  end
29
+
30
+ def padma_account(user)
31
+ if user.current_account.is_a?(PadmaAccount)
32
+ user.current_account
33
+ else
34
+ user.current_account.padma
35
+ end
36
+ end
29
37
 
30
38
  def alpha?(user)
31
39
  user.account_tester_level == 'alpha'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padma-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dwayne Macgowan