mongoid_ability 0.1.4 → 0.1.5

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: 2e288828c255c06a145d7c88a11c5b0b49c8f80c
4
- data.tar.gz: d232f755214a1234c110c8bc12921c044c879165
3
+ metadata.gz: b0209253f4d3a2037374e99a68afa6770b29990d
4
+ data.tar.gz: 0de330daa38560a90247123dfd1aecb9674ab514
5
5
  SHA512:
6
- metadata.gz: 414d902820c8026e7f844347964954c9c7cd26f8ab178a65f9d33eb54b88dd8d84feea832fdb15e1e82d32c1c5a88fa220cde2141f0ed00fc38882ffed429117
7
- data.tar.gz: 68c103c14039e84dc3401dbbd2360f42a45557e960a719f334f5b27e7ed78497f3d43e27a0728910746cbdb025e0c82041992758cf3d1e731adae4203f15c71b
6
+ metadata.gz: 5cc4cb9300ee1bfcc39d1969c3add556be0399f0fd12501cded61b9f402535229a4e0691caff7706ec9c3008cd50a05cf6514642426973050dc5641d5420344d
7
+ data.tar.gz: 0fc9087fcc51d86c025b0daec0e615a0183f97cebb9fe6cb6d6369427ce49214f0cfda81c5f90801a3cd5dafa2f9901e32a1fc49657e414f23ce71a87b81b8a6
@@ -74,5 +74,11 @@ module MongoidAbility
74
74
  lambda { |doc| can? action, doc }
75
75
  end
76
76
 
77
+ def method_missing name, *args
78
+ return super unless name.to_s =~ /\Acannot_/
79
+ return unless action = name.to_s.gsub(/\Acannot_/, '').to_sym
80
+ lambda { |doc| cannot? action, doc }
81
+ end
82
+
77
83
  end
78
84
  end
@@ -1,3 +1,3 @@
1
1
  module MongoidAbility
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_ability
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna