activecube 0.1.34 → 0.1.39

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: d1ec1e26cea7ad07749ac2b6545b0ad83e8aa36cf1b3a996ccced9f1977bd639
4
- data.tar.gz: 8147a433dd7047ac450953b94090dd345aeb9d3e6fd4d2365aa5db5b2ff3e077
3
+ metadata.gz: 849b74aa2966edb904085a1ffe0f0ac9b0450dcb6bc21ab81741ab4b246c25a4
4
+ data.tar.gz: '05138c6ffd9311667dabfe3b98ff2c7e432f77e5a12a89d7675b75284ec3d696'
5
5
  SHA512:
6
- metadata.gz: 0ec017798d5edc0bbe41f60ac1ff90fea9ac80afb0a9652f0374b9b16aac66779ba42dc3b5531e4fcd663afbe188ad0d371e960e599483caa02326f7e3f093f3
7
- data.tar.gz: dea80f006dd4073aa01cda9edd3fb61f3761fb8817879cf198f81b7cc6289f42223aa3e661a1e2a90138418d57f7ef7ecf89a161a950a284d32f4e98e9393269
6
+ metadata.gz: 77c933cba35f04f5611d94da571db185505d81eda693d89b84ebbd952762095f2a561b2745a387bca9b61ce75ea2103a083975b96d3c8ae0f2707b73295df6be
7
+ data.tar.gz: 5998bae42643d1a360b354653d894238365d2079c0ee67571c1ef1a7c566432333ef4c39c26045847b98ab91b6cab83286a82a57c9a296133dee28201b1fc59d
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ /.idea/
1
2
  /.bundle/
2
3
  /.yardoc
3
4
  /_yardoc/
data/Gemfile.lock CHANGED
@@ -9,7 +9,7 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- activecube (0.1.33)
12
+ activecube (0.1.37)
13
13
  activerecord (>= 5.2)
14
14
 
15
15
  GEM
@@ -16,6 +16,8 @@ module Activecube::Query
16
16
  include ChainAppender
17
17
 
18
18
  attr_reader :cube, :slices, :measures, :selectors, :options, :tables, :sql
19
+ attr_accessor :stats
20
+
19
21
  def initialize cube, slices = [], measures = [], selectors = [], options = [], model_tables = nil
20
22
  @cube = cube
21
23
  @slices = slices
@@ -91,8 +93,15 @@ module Activecube::Query
91
93
 
92
94
 
93
95
  def query
94
- sql = to_query.to_sql
95
- @composed.connection.exec_query(sql)
96
+ composed_query = to_query
97
+ connection = @composed.connection
98
+ if connection.respond_to?(:with_statistics)
99
+ connection.with_statistics(stats) do
100
+ connection.exec_query(composed_query.to_sql)
101
+ end
102
+ else
103
+ connection.exec_query(composed_query.to_sql)
104
+ end
96
105
  end
97
106
 
98
107
  def to_query
@@ -13,6 +13,7 @@ module Activecube
13
13
 
14
14
  def connected_to database: nil, role: nil, &block
15
15
  raise Activecube::InputArgumentError, "Must pass block to method" unless block_given?
16
+ raise "Database not defined" unless database
16
17
  super_model.connected_to(database: database, role: role) do
17
18
  @database = database
18
19
  @role = role
@@ -1,3 +1,3 @@
1
1
  module Activecube
2
- VERSION = "0.1.34"
2
+ VERSION = "0.1.39"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activecube
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.34
4
+ version: 0.1.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksey Studnev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-24 00:00:00.000000000 Z
11
+ date: 2022-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -76,7 +76,6 @@ extensions: []
76
76
  extra_rdoc_files: []
77
77
  files:
78
78
  - ".gitignore"
79
- - ".idea/workspace.xml"
80
79
  - ".rspec"
81
80
  - ".travis.yml"
82
81
  - CODE_OF_CONDUCT.md
data/.idea/workspace.xml DELETED
@@ -1,152 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="BranchesTreeState">
4
- <expand>
5
- <path>
6
- <item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
7
- <item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
8
- </path>
9
- </expand>
10
- <select />
11
- </component>
12
- <component name="ChangeListManager">
13
- <list default="true" id="77368870-4045-496a-9737-2c7f83086a16" name="Default Changelist" comment="initial implementation">
14
- <change beforePath="$PROJECT_DIR$/Gemfile.lock" beforeDir="false" afterPath="$PROJECT_DIR$/Gemfile.lock" afterDir="false" />
15
- </list>
16
- <option name="SHOW_DIALOG" value="false" />
17
- <option name="HIGHLIGHT_CONFLICTS" value="true" />
18
- <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
19
- <option name="LAST_RESOLUTION" value="IGNORE" />
20
- </component>
21
- <component name="Git.Settings">
22
- <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
23
- </component>
24
- <component name="ProjectId" id="1Xu9Qappwp8FcqKJZrxzkXK80UI" />
25
- <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
26
- <component name="ProjectViewState">
27
- <option name="hideEmptyMiddlePackages" value="true" />
28
- <option name="showLibraryContents" value="true" />
29
- </component>
30
- <component name="PropertiesComponent">
31
- <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
32
- <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
33
- <property name="WebServerToolWindowFactoryState" value="false" />
34
- <property name="last_opened_file_path" value="$PROJECT_DIR$/lib/activecube" />
35
- <property name="node.js.detected.package.eslint" value="true" />
36
- <property name="node.js.detected.package.tslint" value="true" />
37
- <property name="node.js.path.for.package.eslint" value="project" />
38
- <property name="node.js.path.for.package.tslint" value="project" />
39
- <property name="node.js.selected.package.eslint" value="(autodetect)" />
40
- <property name="node.js.selected.package.tslint" value="(autodetect)" />
41
- <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
42
- <property name="nodejs_npm_path_reset_for_default_project" value="true" />
43
- <property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
44
- </component>
45
- <component name="RecentsManager">
46
- <key name="MoveFile.RECENT_KEYS">
47
- <recent name="$PROJECT_DIR$/lib/activecube" />
48
- </key>
49
- <key name="CopyFile.RECENT_KEYS">
50
- <recent name="$PROJECT_DIR$/lib/activecube" />
51
- </key>
52
- </component>
53
- <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
54
- <component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" RAKE_SPRING_PRE_LOADER_OPTION="true" RAILS_SPRING_PRE_LOADER_OPTION="true" />
55
- <component name="SvnConfiguration">
56
- <configuration />
57
- </component>
58
- <component name="TaskManager">
59
- <task active="true" id="Default" summary="Default task">
60
- <changelist id="77368870-4045-496a-9737-2c7f83086a16" name="Default Changelist" comment="" />
61
- <created>1581885096407</created>
62
- <option name="number" value="Default" />
63
- <option name="presentableId" value="Default" />
64
- <updated>1581885096407</updated>
65
- <workItem from="1581885099890" duration="3547000" />
66
- <workItem from="1621436559886" duration="39000" />
67
- </task>
68
- <task id="LOCAL-00001" summary="initial commit">
69
- <created>1581885128091</created>
70
- <option name="number" value="00001" />
71
- <option name="presentableId" value="LOCAL-00001" />
72
- <option name="project" value="LOCAL" />
73
- <updated>1581885128091</updated>
74
- </task>
75
- <task id="LOCAL-00002" summary="initial implementation">
76
- <created>1581885329956</created>
77
- <option name="number" value="00002" />
78
- <option name="presentableId" value="LOCAL-00002" />
79
- <option name="project" value="LOCAL" />
80
- <updated>1581885329956</updated>
81
- </task>
82
- <task id="LOCAL-00003" summary="initial implementation">
83
- <created>1581886068687</created>
84
- <option name="number" value="00003" />
85
- <option name="presentableId" value="LOCAL-00003" />
86
- <option name="project" value="LOCAL" />
87
- <updated>1581886068687</updated>
88
- </task>
89
- <task id="LOCAL-00004" summary="initial implementation">
90
- <created>1581888304903</created>
91
- <option name="number" value="00004" />
92
- <option name="presentableId" value="LOCAL-00004" />
93
- <option name="project" value="LOCAL" />
94
- <updated>1581888304904</updated>
95
- </task>
96
- <task id="LOCAL-00005" summary="initial implementation">
97
- <created>1581888510999</created>
98
- <option name="number" value="00005" />
99
- <option name="presentableId" value="LOCAL-00005" />
100
- <option name="project" value="LOCAL" />
101
- <updated>1581888510999</updated>
102
- </task>
103
- <option name="localTasksCounter" value="6" />
104
- <servers />
105
- </component>
106
- <component name="TypeScriptGeneratedFilesManager">
107
- <option name="version" value="3" />
108
- </component>
109
- <component name="Vcs.Log.Tabs.Properties">
110
- <option name="TAB_STATES">
111
- <map>
112
- <entry key="MAIN">
113
- <value>
114
- <State />
115
- </value>
116
- </entry>
117
- </map>
118
- </option>
119
- <option name="oldMeFiltersMigrated" value="true" />
120
- </component>
121
- <component name="VcsManagerConfiguration">
122
- <MESSAGE value="initial commit" />
123
- <MESSAGE value="initial implementation" />
124
- <option name="LAST_COMMIT_MESSAGE" value="initial implementation" />
125
- </component>
126
- <component name="WindowStateProjectService">
127
- <state width="1207" height="48" key="GridCell.Tab.0.bottom" timestamp="1581888894138">
128
- <screen x="0" y="23" width="1440" height="786" />
129
- </state>
130
- <state width="1207" height="48" key="GridCell.Tab.0.bottom/0.23.1440.786@0.23.1440.786" timestamp="1581888894138" />
131
- <state width="1207" height="48" key="GridCell.Tab.0.center" timestamp="1581888894135">
132
- <screen x="0" y="23" width="1440" height="786" />
133
- </state>
134
- <state width="1207" height="48" key="GridCell.Tab.0.center/0.23.1440.786@0.23.1440.786" timestamp="1581888894135" />
135
- <state width="1207" height="48" key="GridCell.Tab.0.left" timestamp="1581888894133">
136
- <screen x="0" y="23" width="1440" height="786" />
137
- </state>
138
- <state width="1207" height="48" key="GridCell.Tab.0.left/0.23.1440.786@0.23.1440.786" timestamp="1581888894133" />
139
- <state width="1207" height="48" key="GridCell.Tab.0.right" timestamp="1581888894136">
140
- <screen x="0" y="23" width="1440" height="786" />
141
- </state>
142
- <state width="1207" height="48" key="GridCell.Tab.0.right/0.23.1440.786@0.23.1440.786" timestamp="1581888894136" />
143
- <state x="537" y="156" key="Vcs.Push.Dialog.v2" timestamp="1581888518182">
144
- <screen x="0" y="23" width="1440" height="786" />
145
- </state>
146
- <state x="537" y="156" key="Vcs.Push.Dialog.v2/0.23.1440.786@0.23.1440.786" timestamp="1581888518182" />
147
- <state x="352" y="201" width="819" height="558" key="find.popup" timestamp="1581885294826">
148
- <screen x="0" y="23" width="1440" height="786" />
149
- </state>
150
- <state x="352" y="201" width="819" height="558" key="find.popup/0.23.1440.786@0.23.1440.786" timestamp="1581885294826" />
151
- </component>
152
- </project>