groovy 0.1.4 → 0.1.5

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
  SHA256:
3
- metadata.gz: e12ec33808ce635a4cc1d18432daab18f075fdd6112d41be94c4b3d81039cfb9
4
- data.tar.gz: 72fc2666d2c87469399e7c3297fa69a613e194f95ba22a51f1f4306a7123b36d
3
+ metadata.gz: c90b7fef2c3e9e61d8a3d4a0330edfb035705efd801c5dda53684703ec9cf322
4
+ data.tar.gz: ac5b9735a4e1340776249bb5d9f6c47b72878dec064441586fafbf9d13cf0577
5
5
  SHA512:
6
- metadata.gz: 31599509b743b69e7b0da3f1348da0bbd029b81003685bddc3ce6b95100e8c11f7ad2524ba7b3600925cbd50b5468bae09eba0126d5e8b0072dc032e990be9f4
7
- data.tar.gz: 0f73afaab9eb391731d864aaace675755c713ef32bfa2c045bc1760d5eda25cd67d3f2b395562d31a5bbf7affff0e50ec9c5d923a8f222516a21dec4dfef34f6
6
+ metadata.gz: 89a6be0023c93158048596aa6a8a5d34fad6b69fbe407a468a0426797907c2bd8e2cd6b1eeec1eb9d0bc53c1332ee7f54eddc1e7122765b2a05e75679640602b
7
+ data.tar.gz: cae8bd6799692fcbc8a1ffc8d5b53eadd13d1d5b99591ef7fadd2c11599cba75e6cb7d601698baf59c4ef6564b260d069ea69f5a0d9a4e50a601f368ca365cc8
data/lib/groovy/model.rb CHANGED
@@ -168,8 +168,8 @@ module Groovy
168
168
  # end
169
169
 
170
170
  [:search, :where, :not, :sort_by, :limit, :offset, :paginate, :in_batches].each do |scope_method|
171
- define_method scope_method do |*args|
172
- query.public_send(scope_method, *args)
171
+ define_method scope_method do |*args, &block|
172
+ query.public_send(scope_method, *args, &block)
173
173
  end
174
174
  end
175
175
 
@@ -294,7 +294,7 @@ module Groovy
294
294
  end
295
295
 
296
296
  def update_attributes!(obj)
297
- update_attributes or raise "Invalid!"
297
+ update_attributes(obj) or raise "Invalid!"
298
298
  end
299
299
 
300
300
  def save(options = {})
data/lib/groovy/query.rb CHANGED
@@ -172,7 +172,7 @@ module Groovy
172
172
  records[size-1]
173
173
  end
174
174
 
175
- def in_batches(of: 1000, from: nil)
175
+ def in_batches(of: 1000, from: nil, &block)
176
176
  @sorting[:limit] = of
177
177
  @sorting[:offset] = from || 0
178
178
 
@@ -223,8 +223,6 @@ module Groovy
223
223
  table.select(options)
224
224
  end
225
225
 
226
- puts set.expression.inspect
227
-
228
226
  @total_entries = set.size
229
227
 
230
228
  puts "Sorting with #{sort_key_and_order}, #{sorting.inspect}" if ENV['DEBUG']
data/lib/groovy/schema.rb CHANGED
@@ -139,7 +139,7 @@ module Groovy
139
139
 
140
140
  def has_column?(name, type = nil)
141
141
  table.columns.any? do |col|
142
- col.name == "#{table_name}.#{name}" # && (type.nil? or col.type == type)
142
+ col && col.name == "#{table_name}.#{name}" # && (type.nil? or col.type == type)
143
143
  end
144
144
  end
145
145
 
@@ -1,3 +1,3 @@
1
1
  module Groovy
2
- VERSION = '0.1.4'.freeze
2
+ VERSION = '0.1.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groovy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomás Pollak