hairtrigger 0.2.23 → 0.2.24

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: 4d356cd237fc665b8045d0fcf24ff67dd2eef12f
4
- data.tar.gz: f037b001d957906745c444dedcd13d1d8a4f2a71
3
+ metadata.gz: b3a4b255f8184decc442a9c455f5b8a5a5c9bd48
4
+ data.tar.gz: b6c202c7328de121c67161cc4d31d83926076044
5
5
  SHA512:
6
- metadata.gz: f98a664cd3c2da80a06de3bcf6605edef88475eead1c37ce6878730791dc69c79bfef723677c8d24c1de17508e94b14a0a964abe5b966b01cc615e139b059d49
7
- data.tar.gz: 24def9f4a0caa7a13db0139b396ee0dfe634074139da0395dfb88b12653fb2681a584660f6befd02cd8cd9cff195908db58a71667fa75ed42140f46710dbe1d3
6
+ metadata.gz: 5eb6f48db749f2841ee9a0b986dbaf9cf2d93f48f687822e8a6dda52c90e45165fba783510e7fb1e5ec8a490ce4a6dd58df5f2ebd04567e3d2839f87ef82815f
7
+ data.tar.gz: c8eebfc8a7a45d4987f1d6ea5281a06c333a4eee929830a73a78521c442983b1743f14a4f677fb31de9d4a7ce6b144f67000f84cd7c068d08160ef260bb815cf
data/README.md CHANGED
@@ -348,4 +348,4 @@ that w/ automagical gemfiles. So the tl;dr when testing locally is:
348
348
 
349
349
  ## Copyright
350
350
 
351
- Copyright (c) 2011-2019 Jon Jensen. See LICENSE.txt for further details.
351
+ Copyright (c) 2011-2021 Jon Jensen. See LICENSE.txt for further details.
@@ -226,7 +226,9 @@ end
226
226
  end
227
227
  end
228
228
 
229
- ActiveRecord::Base.send :extend, HairTrigger::Base
230
- ActiveRecord::Migration.send :include, HairTrigger::Migrator
231
- ActiveRecord::ConnectionAdapters::AbstractAdapter.class_eval { include HairTrigger::Adapter }
232
- ActiveRecord::SchemaDumper.class_eval { include HairTrigger::SchemaDumper }
229
+ ActiveSupport.on_load(:active_record) do
230
+ ActiveRecord::Base.send :extend, HairTrigger::Base
231
+ ActiveRecord::Migration.send :include, HairTrigger::Migrator
232
+ ActiveRecord::ConnectionAdapters::AbstractAdapter.class_eval { include HairTrigger::Adapter }
233
+ ActiveRecord::SchemaDumper.class_eval { include HairTrigger::SchemaDumper }
234
+ end
@@ -137,22 +137,22 @@ module HairTrigger
137
137
  methods.each do |method|
138
138
  class_eval <<-METHOD, __FILE__, __LINE__ + 1
139
139
  alias #{method}_orig #{method}
140
- def #{method}(*args)
140
+ def #{method}(*args, &block)
141
141
  @chained_calls << :#{method}
142
142
  if @triggers || @trigger_group
143
143
  @errors << ["mysql doesn't support #{method} within a trigger group", :mysql] unless [:name, :where, :all, :of].include?(:#{method})
144
144
  end
145
- set_#{method}(*args, &(block_given? ? Proc.new : nil))
145
+ set_#{method}(*args, &(block_given? ? block : nil))
146
146
  end
147
- def set_#{method}(*args)
147
+ def set_#{method}(*args, &block)
148
148
  if @triggers # i.e. each time we say t.something within a trigger group block
149
149
  @chained_calls.pop # the subtrigger will get this, we don't need it
150
150
  @chained_calls = @chained_calls.uniq
151
151
  @triggers << trigger = clone
152
- trigger.#{method}(*args, &(block_given? ? Proc.new : nil))
152
+ trigger.#{method}(*args, &(block_given? ? block : nil))
153
153
  else
154
- #{method}_orig(*args)
155
- maybe_execute(&Proc.new) if block_given?
154
+ #{method}_orig(*args, &block)
155
+ maybe_execute(&block) if block_given?
156
156
  self
157
157
  end
158
158
  end
@@ -67,7 +67,7 @@ module HairTrigger
67
67
  def normalize_trigger(name, definition, type)
68
68
  @adapter_name = @connection.adapter_name.downcase.to_sym
69
69
 
70
- return definition unless @adapter_name == :postgresql
70
+ return definition unless @adapter_name == :postgresql || @adapter_name == :postgis
71
71
  # because postgres does not preserve the original CREATE TRIGGER/
72
72
  # FUNCTION statements, its decompiled reconstruction will not match
73
73
  # ours. we work around it by creating our generated trigger/function,
@@ -1,5 +1,5 @@
1
1
  module HairTrigger
2
- VERSION = "0.2.23"
2
+ VERSION = "0.2.24"
3
3
 
4
4
  def VERSION.<=>(other)
5
5
  split(/\./).map(&:to_i) <=> other.split(/\./).map(&:to_i)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hairtrigger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.23
4
+ version: 0.2.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Jensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-04 00:00:00.000000000 Z
11
+ date: 2021-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  requirements: []
101
101
  rubyforge_project:
102
- rubygems_version: 2.6.13
102
+ rubygems_version: 2.5.2.3
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: easy database triggers for active record