active_house 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1881c335facd03315b054272bda63feb0dad94bc
4
- data.tar.gz: 3ff3163f387c26d522c21ada86e53e428af96e6b
3
+ metadata.gz: 1accc2700d5a5f68d28c6ee7a3c61edee951663a
4
+ data.tar.gz: e3376ff0588800672aa83312f8d648f982bd7684
5
5
  SHA512:
6
- metadata.gz: 1c3855225c06b94397b6ab83ccd9eb016a49db843a423e0ccd8205c8c88a9eb41a55e56d952e68b34651ae6de5aa7eeb45244945eb95014e136b083900631e62
7
- data.tar.gz: f95934da0a72bc53c9a95d026ae33a476eacc7718653585f44c83d5d7634a1dd125b6bd6a682c49094c207b20b7c2aa74abb6679cbc2cc7160cb0fd0394c1212
6
+ metadata.gz: d75af3bdb4a7330bf48d0002babe1c9e807b4e359129ec9a9ca30557f2761c990d7ada2567fd5b756bd3d7bb1d47f1a11db9a456e73c02eec8d5aac319e96ba6
7
+ data.tar.gz: 6ab03f7ce71326c65dd3d60173b93c5b02d6e427acd14d277ed0ca768ceb3960ea3edd60b695ae367c359c17fa516114e489197b957fb57468aa99d717da01bd
@@ -8,7 +8,6 @@ module ActiveHouse
8
8
  value = idx + 1 > bindings.size ? nil : format_value(bindings[idx])
9
9
  "#{part}#{value}"
10
10
  end.join
11
- sql
12
11
  end
13
12
 
14
13
  def self.format_value(value)
@@ -7,7 +7,7 @@ module ActiveHouse
7
7
  included do
8
8
  private
9
9
 
10
- def apply_scope(name)
10
+ def apply_scope(name, *args)
11
11
  scope = model_class._scopes.fetch(name.to_sym)
12
12
  instance_exec(*args, &scope)
13
13
  end
@@ -33,7 +33,7 @@ module ActiveHouse
33
33
 
34
34
  def method_missing(method_name, *args, &_block)
35
35
  if scope?(method_name)
36
- apply_scope(method_name)
36
+ apply_scope(method_name, *args)
37
37
  else
38
38
  super
39
39
  end
@@ -7,12 +7,10 @@ module ActiveHouse
7
7
 
8
8
  def build_select_query_part
9
9
  if !@fields.empty?
10
- query_data = ['SELECT']
11
- query_data.concat @fields
10
+ "SELECT\n#{@fields.join(",\n")}"
12
11
  else
13
- query_data = ['SELECT *']
12
+ 'SELECT *'
14
13
  end
15
- query_data.join("\n")
16
14
  end
17
15
  end
18
16
 
@@ -1,3 +1,3 @@
1
1
  module ActiveHouse
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_house
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Talakevich