who_comes_first 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/who_comes_first.rb +2 -1
  2. metadata +3 -2
@@ -1,5 +1,5 @@
1
1
  class WhoComesFirst
2
-
2
+ #Specify the model class and list of methods that you require the order of execution(optional)
3
3
  def self.who_comes_first(model,methods = [],operation = :create)
4
4
  callbacks_name_list = [:before_validation,
5
5
  "before_validation_on_#{operation}".to_sym,
@@ -13,6 +13,7 @@ class WhoComesFirst
13
13
  "after_commit_on_#{operation}".to_sym
14
14
  ]
15
15
  callbacks_name_list.each { |callback_name| model.send(callback_name).each { |cb| process_callback(cb,methods)}}
16
+ nil
16
17
  end
17
18
  private
18
19
  def self.process_callback(cb,methods)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: who_comes_first
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,8 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2015-06-13 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: Who Comes First
14
+ description: Gem that will list the callbacks in the model in their order of execution.
15
+ It can also take in array of methods and list them in their order of execution.
15
16
  email: karthickpdy@gmail.com
16
17
  executables: []
17
18
  extensions: []