triggerable 0.1.15 → 0.1.16

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: 3a1e847d6791f35c859f400d4a4004461f9e0d9c
4
- data.tar.gz: 3e84919f46ac7d801f6239ceb34d7e529fb5f49a
3
+ metadata.gz: 028658b0ddf347d856dbeda24c96e39579f4b6c2
4
+ data.tar.gz: c7818e0a0a5d22679f6132dba443d7eded262bde
5
5
  SHA512:
6
- metadata.gz: 44c6eb39c11620c769aefe764a987cae884c7871caba17d137e7b2f4280f51eeb522734363b3c2fe2aab8cee9b8b1cf74157b50639df6900c5e74da7a56f9f1c
7
- data.tar.gz: 18deb64499de6b211b69775e2add3ef6ce364cd2cbd75d08a7e52a562e95bd9f6dc890afa27e6d49377a2e1ec193877c186ac0a51142a0c4c40c9650cacec068
6
+ metadata.gz: 32583ca8a038bb161c9fe4226563b62e2460016fe3645c5340d48a6fe4d05629d1eb197c6b3e58dac994aa1ec20f4f9c28e089335876b2e85c200283e00d4053
7
+ data.tar.gz: b2c484e8f0c4c87888c361fdecd2a2decc7d6c77289e56f5cb65f5b71a432a35831cab042e3f397685268afecaaf55a2fff873a3eca096babe5f3183a7332721
@@ -45,7 +45,7 @@ module Triggerable
45
45
  CALLBACKS.each do |callback|
46
46
  method_name = "run_#{callback}_triggers"
47
47
  define_method(method_name) { run_triggers(callback) }
48
- send(callback, method_name)
48
+ send(callback, method_name.to_sym)
49
49
  end
50
50
 
51
51
  private
@@ -26,7 +26,7 @@ module Triggerable
26
26
  private
27
27
 
28
28
  def build_query
29
- table = Arel::Table.new(model.table_name)
29
+ table = model.arel_table
30
30
  query = table.where(@condition.scope(table))
31
31
  .project(Arel.sql('id'))
32
32
  .to_sql
@@ -1,3 +1,3 @@
1
1
  module Triggerable
2
- VERSION = '0.1.15'
2
+ VERSION = '0.1.16'
3
3
  end
@@ -11,7 +11,7 @@ describe 'Scopes' do
11
11
 
12
12
  context 'field conditions' do
13
13
  def model_ids_for condition_class, arg
14
- table = Arel::Table.new(:parent_models)
14
+ table = ParentModel.arel_table
15
15
  scope = condition_class.new(:integer_field, arg).scope(table)
16
16
  query = table.where(scope).project(Arel.sql('id')).to_sql
17
17
 
@@ -59,7 +59,7 @@ describe 'Scopes' do
59
59
  and_condition = condition_class.new([])
60
60
  and_condition.conditions = [Triggerable::Conditions::Is.new(:integer_field, 1), Triggerable::Conditions::Is.new(:string_field, 'c')]
61
61
 
62
- table = Arel::Table.new(:parent_models)
62
+ table = ParentModel.arel_table
63
63
  query = table.where(and_condition.scope(table)).project(Arel.sql('id')).to_sql
64
64
 
65
65
  ParentModel.connection.execute(query).map { |r| r['id'] }
@@ -75,4 +75,4 @@ describe 'Scopes' do
75
75
  expect(ids).to eq([@m1.id, @m3.id])
76
76
  end
77
77
  end
78
- end
78
+ 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.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - DmitryTsepelev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-11 00:00:00.000000000 Z
11
+ date: 2016-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  version: '0'
176
176
  requirements: []
177
177
  rubyforge_project:
178
- rubygems_version: 2.4.8
178
+ rubygems_version: 2.6.6
179
179
  signing_key:
180
180
  specification_version: 4
181
181
  summary: Triggerable is a powerful engine for adding a conditional behaviour for ActiveRecord