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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1accc2700d5a5f68d28c6ee7a3c61edee951663a
|
4
|
+
data.tar.gz: e3376ff0588800672aa83312f8d648f982bd7684
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d75af3bdb4a7330bf48d0002babe1c9e807b4e359129ec9a9ca30557f2761c990d7ada2567fd5b756bd3d7bb1d47f1a11db9a456e73c02eec8d5aac319e96ba6
|
7
|
+
data.tar.gz: 6ab03f7ce71326c65dd3d60173b93c5b02d6e427acd14d277ed0ca768ceb3960ea3edd60b695ae367c359c17fa516114e489197b957fb57468aa99d717da01bd
|
@@ -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
|
-
|
11
|
-
query_data.concat @fields
|
10
|
+
"SELECT\n#{@fields.join(",\n")}"
|
12
11
|
else
|
13
|
-
|
12
|
+
'SELECT *'
|
14
13
|
end
|
15
|
-
query_data.join("\n")
|
16
14
|
end
|
17
15
|
end
|
18
16
|
|
data/lib/active_house/version.rb
CHANGED