safe_callbacks 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/safe_callbacks.rb +11 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDJhODVkMjFhNjhhOGM5MmQ4ZGFjYWEwMDY3MDRiM2EyZDc1YzMyMg==
4
+ YTdjZjFiNDRiZDgzNTA0NzFmYWUwZTI3NjE5ZmRkOGNjZTAzMGQ2Zg==
5
5
  data.tar.gz: !binary |-
6
- Njc1NDU4MGExYmVlNDQ4ZmEyYTU0NmY4OWM2MWY1YmIxYjA4YjQxZQ==
6
+ YzY1Y2NmNzc5NTY2ZTJlODQ2Y2ZkNzYwYmMwMzI0YjhlYjgwYWExMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTg5YWI4NmMxMzhkNWIxYzc4NGRjNDE4YjkyZGNkY2M5MjgyMGM0YWY5MTc3
10
- ZGVmMmQxNjM2OTY1MDc0MmI1Y2E3OGRiMjc2Zjc5NjFlNmRjYzU0Mzg1ZTVi
11
- MDk4MmFlOWVkNGI2YjFlZTkyYzA3YWRlNTZiMTNhMjA1OWU2MGY=
9
+ MWJlNDFlZTRlNDk4NWE1OTAzMWY4N2UwMjU0NzU5NmExNjRkOTRlMjRiZmVk
10
+ M2Y2YmQ4Y2U3NmI0ZTY5NTZmNTU3NjA5MTViOWMxNTE4YmQzZDc5YjQ3OWFh
11
+ YjExOGJjNjU0OWVkMmIwM2UwY2ZlMjllYzliZTlmMzZiOWEwZmM=
12
12
  data.tar.gz: !binary |-
13
- ZWFjOGRiOTZlMmI5ODM1OGRmYjcyYmQ2ZGE1MmUxY2M0YTgzYzM0Mjc4NGU4
14
- NTFkY2E1ZGI0NzllNWRjMzNlNGZjNGQ1M2NkMzliNjExMzdmMTkyNTczOGNj
15
- NDc4NTQxZmQ4MGM2Y2E2N2U4ZWFhYzcxMjM4ODU5OTI3MjI1MWQ=
13
+ MDM2ODhhZmYyMTJjMDI1MjBlYTQwZTI2OTFmOTU0Yjg0MGRjZTZmZGJkMGFh
14
+ OTg0MWYzNDc4NTk4MTY0NWQ2NGUyMTdhMGE4NzE4YmUxMDM1Zjg2NTYyZmEy
15
+ NDE3YzBkNzQ3MWI3NjVlM2QwMTFmZTc5NDVjOGQxNjkyZjM3YWM=
@@ -14,6 +14,10 @@ module SafeCallbacks
14
14
  ]
15
15
 
16
16
  class << self
17
+ def extend_mongo_mapper!
18
+ MongoMapper::Document.extend SafeCallbacks::MongoMapperExtension
19
+ end
20
+
17
21
  def extended(mod)
18
22
  SafeCallbacks::CALLBACK_METHODS.each do |callback_method_name|
19
23
  unsafe_callback_method_name = :"unsafe_#{callback_method_name}"
@@ -33,6 +37,13 @@ module SafeCallbacks
33
37
  end
34
38
  end
35
39
 
40
+ module MongoMapperExtension
41
+ def included(mod)
42
+ super
43
+ mod.extend SafeCallbacks
44
+ end
45
+ end
46
+
36
47
  module ClassMethods
37
48
  CALLBACK_METHODS.each do |callback_method_name|
38
49
  define_method callback_method_name do |method_name, options={}|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safe_callbacks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Taylor