active_house 0.2.1 → 0.2.2

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: e8604e8b710205124b594cb7f226fbc04f444875
4
- data.tar.gz: 4130c550f2386afe4cd26953e219fadbff652b98
3
+ metadata.gz: 82c05801fc7ad814630b97ef96b98266eb55878e
4
+ data.tar.gz: 884f6a16ba8a523068bceaf636e22c62ca73861f
5
5
  SHA512:
6
- metadata.gz: fe1797a3645326c8cd9e8e0ab90e570b4d4e00722fd2aad537706a474391d7702e3d8c3846b428f493c738da63b929c3227e6cd0a1a70c23c46983de4184b617
7
- data.tar.gz: f699b40bfcda2ea589d047cb3624261bb1bde8024f5e0a047b4221d4a56513befa7e22a85a64c74da33aaeced0151d5e0670d0e1341aa1ae398ca60d3f6f371a
6
+ metadata.gz: eec19aa3942c2980ce9d776977d4f174a9e66712b8410b753705673296c320573b801bc7d1f192891e4e7b81e23a1b8d48428ca66c23f17475b9cba5ef798ba1
7
+ data.tar.gz: 5e88fa243733382fe2d0c28cc61311bb9428b89f2e0587b6e6755e482132ed3c308fce7b2fe9269a169d68ddd5e77c1bcfafbaee39ad214a8d4fbf48cffa2bf1
@@ -33,7 +33,7 @@ module ActiveHouse
33
33
  end
34
34
 
35
35
  def fetch_collection
36
- to_hash.map { |row| model_class.load!(row) }
36
+ to_hashes.map { |row| model_class.load!(row) }
37
37
  end
38
38
  end
39
39
  end
@@ -40,6 +40,10 @@ module ActiveHouse
40
40
  select_all(sql, *bindings).to_hashes
41
41
  end
42
42
 
43
+ def raw_query(sql)
44
+ connection.get(sql)
45
+ end
46
+
43
47
  def connection_alive?
44
48
  return false if connection.nil?
45
49
  if connection.is_a?(Clickhouse::Cluster)
@@ -34,6 +34,12 @@ module ActiveHouse
34
34
  def attribute(name, options = {})
35
35
  name = name.to_sym
36
36
  self._attribute_opts = _attribute_opts.merge(name => options)
37
+ define_method(name) do
38
+ get_attribute(name)
39
+ end
40
+ define_method("#{name}=") do |value|
41
+ set_attribute(name, value)
42
+ end
37
43
  end
38
44
 
39
45
  def attributes(*names)
@@ -1,3 +1,3 @@
1
1
  module ActiveHouse
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.2.2'.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.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Talakevich