triggerable 0.1.0 → 0.1.1

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: eccbfd503b44b892a1247b8dde94381fba3017ed
4
- data.tar.gz: a159bb8a7559a264be77616c3d8bd83f144aa0ff
3
+ metadata.gz: 49133136262b0acdb06a687a60c018db263d8a04
4
+ data.tar.gz: 4385cdecc97b3520259cd1c59f60228e00a8fd87
5
5
  SHA512:
6
- metadata.gz: bf594d01a28d8a826c38d13db346027233b5419147406d725d53e35e4e39bfb260689693ceec44e83000b83eb708a5d2b3343498d64c4d167b8dc06435dd4c9a
7
- data.tar.gz: 6bef7a97e9236f09954cacdc30c76b4f3b9012864b2168115c0e2a482ea136630267c5d99f8bae96bd1bf34c75f8c1da9938acae1cb093790d067ffe75f4f51e
6
+ metadata.gz: 1b8e5ab08307ff8886086dab858e95b9a3df770fa59ea8296a331d16b6397cf18643231a2351b987787aedc61961a7a44db3628811d4f40968150fad7fd5a8ab
7
+ data.tar.gz: bd7b0953dba3f5e765b13a4d3460e4612c33075748417bfe89ab602b9fa3a639b0e2d579992fe7190ad6f2e06c16c3e61fba92454feca21ba3702e6289def0c3
@@ -39,7 +39,7 @@ module Triggerable
39
39
  private
40
40
 
41
41
  def run_triggers callback
42
- Engine.triggers_for(self.class, callback).each{|t| t.execute!(self)}
42
+ Engine.triggers_for(self, callback).each{|t| t.execute!(self)}
43
43
  end
44
44
  end
45
45
 
@@ -12,8 +12,8 @@ class Engine
12
12
  self.automations << Rules::Automation.new(model, options, block)
13
13
  end
14
14
 
15
- def self.triggers_for model, callback
16
- triggers.select{|t| t.model == model && t.callback == callback }
15
+ def self.triggers_for obj, callback
16
+ triggers.select{|t| obj.is_a?(t.model) && t.callback == callback }
17
17
  end
18
18
 
19
19
  def self.run_automations interval
@@ -1,3 +1,3 @@
1
1
  module Triggerable
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: triggerable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - DmitryTsepelev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-24 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  version: '0'
175
175
  requirements: []
176
176
  rubyforge_project:
177
- rubygems_version: 2.2.2
177
+ rubygems_version: 2.4.2
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: Triggerable is a powerful engine for adding a conditional behaviour for ActiveRecord