jungle_path 0.0.12 → 0.0.13
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 +4 -4
- data/lib/jungle_path/app/api/base.rb +2 -1
- data/lib/jungle_path/app/config/config.rb +28 -3
- data/lib/jungle_path/app/schemas/schema.rb +25 -0
- data/lib/jungle_path/app/schemas/views.rb +34 -0
- data/lib/jungle_path/app/ztools/zbootstrapdata.rb +8 -1
- data/lib/jungle_path/authentication/auth_provider/default.rb +3 -3
- data/lib/jungle_path/authentication/data_provider/default.rb +47 -15
- data/lib/jungle_path/authentication/data_provider/test.rb +38 -0
- data/lib/jungle_path/authentication/identity.rb +12 -3
- data/lib/jungle_path/db_model/view.rb +18 -0
- data/lib/jungle_path/gen/schema.rb +1 -1
- data/lib/jungle_path/query/from.rb +6 -2
- data/lib/jungle_path/query/sql_string.rb +22 -0
- data/lib/jungle_path/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3d7af2ccd2d0dee2d679b8c544bb5490dad5ca1
|
4
|
+
data.tar.gz: b4d6e98aea0b599ea9eca0c7fe45f9e995d59a6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71a3d3dbf58cf74c883401463c0d0fff2bcb98cffe20556185be44463b04b62049678c96d8bf116319d79eb0d8a44db5a3d72c72a8372e5ec2a4b16d0b866dd9
|
7
|
+
data.tar.gz: de05d0e32c106570d48dd1bb19ca6a341d9dcc5b25905674076bf998c455a82f48646fb4a46ff67bee13a4ced00bea802d857ffe4bcde96d8d436bae67efebf9
|
@@ -81,7 +81,8 @@ module Server
|
|
81
81
|
puts "authenticate no_cache: #{no_cache}."
|
82
82
|
#data_provider = JunglePath::Authentication::DataProvider::Test.new(Schema::Base.models)
|
83
83
|
#def initialize db, user_model, models, roles, schema_filters, role_schema_filters, role_query_filters, restriction_query_filters, user_query_filters
|
84
|
-
|
84
|
+
alternative_user_key_queries = [{name: :contact_id, query: "select id as alt_key from contact where user_id = ?"}]
|
85
|
+
data_provider = JunglePath::Authentication::DataProvider::Default.new(self, cache, db, ::Schema::User, ::Schema::Base.models, jungle.roles, jungle.schema_filters, jungle.role_schema_filters, jungle.role_query_filters, jungle.restriction_query_filters, jungle.user_query_filters, jungle.role_table_filters, jungle.restriction_table_filters, jungle.user_table_filters, alternative_user_key_queries)
|
85
86
|
auth_provider = JunglePath::Authentication::AuthProvider::Default.new
|
86
87
|
authenticate auth_provider, data_provider, no_cache
|
87
88
|
end
|
@@ -22,6 +22,9 @@ module Config
|
|
22
22
|
role_query_filters
|
23
23
|
restriction_query_filters
|
24
24
|
user_query_filters
|
25
|
+
role_table_filters
|
26
|
+
restriction_table_filters
|
27
|
+
user_table_filters
|
25
28
|
#permissions_and_restrictions
|
26
29
|
route_access
|
27
30
|
debug
|
@@ -189,9 +192,9 @@ module Config
|
|
189
192
|
def self.restriction_query_filters
|
190
193
|
jungle.restriction_query_filters = lambda {|identity|
|
191
194
|
filters = {
|
192
|
-
me_related:[
|
193
|
-
|
194
|
-
]
|
195
|
+
#me_related:[
|
196
|
+
# {table_name: :user, sub_select: "select id from user where id = #{identity.user.id}"}
|
197
|
+
#]
|
195
198
|
}
|
196
199
|
}
|
197
200
|
end
|
@@ -202,6 +205,28 @@ module Config
|
|
202
205
|
}
|
203
206
|
end
|
204
207
|
|
208
|
+
def self.role_table_filters
|
209
|
+
# Replace usage of a table in a query with the given view or parameterized function
|
210
|
+
jungle.role_table_filters = {
|
211
|
+
user: [
|
212
|
+
{table_name: :contact, replacement: :filter_contact}
|
213
|
+
]
|
214
|
+
# more...
|
215
|
+
}
|
216
|
+
end
|
217
|
+
|
218
|
+
def self.restriction_table_filters
|
219
|
+
jungle.restriction_table_filters = {
|
220
|
+
me_related:[
|
221
|
+
{table_name: :contact, replacement: :filter_contact}
|
222
|
+
]
|
223
|
+
}
|
224
|
+
end
|
225
|
+
|
226
|
+
def self.user_table_filters
|
227
|
+
jungle.user_table_filters = {}
|
228
|
+
end
|
229
|
+
|
205
230
|
def self.route_access
|
206
231
|
jungle.route_access = {
|
207
232
|
public: {
|
@@ -6,6 +6,7 @@ require 'jungle_path/schema/version'
|
|
6
6
|
require 'jungle_path/schema/base'
|
7
7
|
require 'jungle_path/schema/db'
|
8
8
|
require 'jungle_path/schema/auth'
|
9
|
+
require_relative 'views'
|
9
10
|
|
10
11
|
# application tables examples:
|
11
12
|
module Schema
|
@@ -20,6 +21,30 @@ module Schema
|
|
20
21
|
)
|
21
22
|
end
|
22
23
|
|
24
|
+
class Contact < Schema::Base
|
25
|
+
self.description = ""
|
26
|
+
define(
|
27
|
+
[:id, :primary_key],
|
28
|
+
[:name, :string],
|
29
|
+
[:email, :string],
|
30
|
+
[:user_id, :foreign_key, :user, :unique],
|
31
|
+
[:audit_user]
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
class FilterContact < Schema::Base
|
36
|
+
self.description = "Test View filter stuff."
|
37
|
+
define(
|
38
|
+
[:id, :primary_key],
|
39
|
+
[:name, :string],
|
40
|
+
[:email, :string],
|
41
|
+
[:user_id, :foreign_key, :user],
|
42
|
+
[:audit_user]
|
43
|
+
)
|
44
|
+
self.view = Views.filter_contact
|
45
|
+
end
|
46
|
+
|
47
|
+
|
23
48
|
class Practice < Schema::Base
|
24
49
|
self.description = ""
|
25
50
|
define(
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'jungle_path/sql/helpers'
|
2
|
+
require 'jungle_path/db_model/view'
|
3
|
+
|
4
|
+
module Views
|
5
|
+
def self.filter_contact
|
6
|
+
@f = JunglePath::DBModel::View.new(
|
7
|
+
JunglePath::SQL::Helpers.sql("
|
8
|
+
create or replace function filter_contact(p_contact_id int)
|
9
|
+
returns table (
|
10
|
+
id int,
|
11
|
+
name text,
|
12
|
+
email text,
|
13
|
+
user_id int,
|
14
|
+
created_at timestamp,
|
15
|
+
created_by_user_id int,
|
16
|
+
updated_at timestamp,
|
17
|
+
updated_by_user_id int
|
18
|
+
)
|
19
|
+
as
|
20
|
+
$body$
|
21
|
+
select
|
22
|
+
a.*
|
23
|
+
from contact a
|
24
|
+
where a.id = p_contact_id
|
25
|
+
$body$
|
26
|
+
language sql;
|
27
|
+
"),
|
28
|
+
"drop function filter_contact(int)",
|
29
|
+
[:user],
|
30
|
+
[:contact_id]
|
31
|
+
) unless @f
|
32
|
+
@f
|
33
|
+
end
|
34
|
+
end
|
@@ -31,6 +31,13 @@ module ZBootstrap
|
|
31
31
|
]
|
32
32
|
users.each {|user| db.insert._model(user)}
|
33
33
|
|
34
|
+
contacts = [
|
35
|
+
Schema::Contact.new({id: 0, name: 'root', email: 'root@junglepath.com', user_id: 0, created_by_user_id: 0, updated_by_user_id: 0}),
|
36
|
+
Schema::Contact.new({id: 1, name: 'admin', email: 'admin@junglepath.com', user_id: 1, created_by_user_id: 0, updated_by_user_id: 0}),
|
37
|
+
Schema::Contact.new({id: 2, name: 'user', email: 'user@junglepath.com', user_id: 2, created_by_user_id: 0, updated_by_user_id: 0})
|
38
|
+
]
|
39
|
+
contacts.each {|contact| db.insert._model(contact)}
|
40
|
+
|
34
41
|
#roles = [
|
35
42
|
# Schema::Role.new({id: 0, name: 'root', description: 'do anything', created_by_user_id: 0, updated_by_user_id: 0}),
|
36
43
|
# Schema::Role.new({id: 1, name: 'admin', description: 'general admin -- filtered by organization', created_by_user_id: 0, updated_by_user_id: 0}),
|
@@ -51,7 +58,7 @@ module ZBootstrap
|
|
51
58
|
def self.fix_serial db=nil
|
52
59
|
db = Server::API::DB.instance unless db
|
53
60
|
db.reset_sequence_for_table("user")
|
54
|
-
|
61
|
+
db.reset_sequence_for_table("contact")
|
55
62
|
end
|
56
63
|
end
|
57
64
|
|
@@ -70,7 +70,7 @@ module JunglePath
|
|
70
70
|
end
|
71
71
|
idn.valid = (idn.user and idn.user.is_valid)
|
72
72
|
if idn.valid
|
73
|
-
idn.
|
73
|
+
idn.alternative_user_keys = data_provider.get_alternative_user_keys(idn.user.id, no_cache) if data_provider.respond_to?('get_alternative_user_keys')
|
74
74
|
end
|
75
75
|
end
|
76
76
|
idn
|
@@ -84,12 +84,12 @@ module JunglePath
|
|
84
84
|
idn.role = data_provider.get_role(idn, no_cache)
|
85
85
|
idn.authorization_filter = data_provider.get_authorization_filter(idn, no_cache)
|
86
86
|
idn.query_filters = data_provider.get_query_filters(idn, no_cache)
|
87
|
-
|
87
|
+
idn.table_filters = data_provider.get_table_filters(idn, no_cache) if data_provider.respond_to?('get_table_filters')
|
88
88
|
else
|
89
89
|
idn.role = nil
|
90
90
|
idn.authorization_filter = nil
|
91
91
|
idn.query_filters = nil
|
92
|
-
|
92
|
+
idn.table_filters = nil
|
93
93
|
end
|
94
94
|
end
|
95
95
|
idn
|
@@ -7,7 +7,7 @@ module JunglePath
|
|
7
7
|
module Authentication
|
8
8
|
module DataProvider
|
9
9
|
class Default
|
10
|
-
def initialize sinatra, cache, db, user_model, models, roles, schema_filters, role_schema_filters, role_query_filters, restriction_query_filters, user_query_filters,
|
10
|
+
def initialize sinatra, cache, db, user_model, models, roles={}, schema_filters={}, role_schema_filters={}, role_query_filters=nil, restriction_query_filters=nil, user_query_filters=nil, role_table_filters=nil, restriction_table_filters=nil, user_table_filters=nil, alternative_user_key_queries=nil
|
11
11
|
@sinatra = sinatra
|
12
12
|
@cache = cache
|
13
13
|
@db = db
|
@@ -25,7 +25,10 @@ module JunglePath
|
|
25
25
|
@role_query_filters = role_query_filters
|
26
26
|
@restriction_query_filters = restriction_query_filters
|
27
27
|
@user_query_filters = user_query_filters
|
28
|
-
@
|
28
|
+
@role_table_filters = role_table_filters
|
29
|
+
@restriction_table_filters = restriction_table_filters
|
30
|
+
@user_table_filters = user_table_filters
|
31
|
+
@alternative_user_key_queries = alternative_user_key_queries
|
29
32
|
end
|
30
33
|
|
31
34
|
def get_user(user_name, password, assume_identity=false, no_cache=false)
|
@@ -77,12 +80,12 @@ module JunglePath
|
|
77
80
|
def get_query_filters(identity, no_cache=false)
|
78
81
|
filters = []
|
79
82
|
|
80
|
-
temp_filters = @role_query_filters.call(identity)[identity.role] || []
|
83
|
+
temp_filters = (@role_query_filters && @role_query_filters.call(identity)[identity.role]) || []
|
81
84
|
temp_filters.each do |filter|
|
82
85
|
filters << JunglePath::Query::Filter.new(filter[:table_name], filter[:sub_select])
|
83
86
|
end
|
84
87
|
|
85
|
-
temp_filters = @restriction_query_filters.call(identity)
|
88
|
+
temp_filters = (@restriction_query_filters && @restriction_query_filters.call(identity)) || {}
|
86
89
|
identity.authorization_filter.restrictions.each do |restriction|
|
87
90
|
temp = temp_filters[restriction] || []
|
88
91
|
temp.each do |filter|
|
@@ -90,7 +93,7 @@ module JunglePath
|
|
90
93
|
end
|
91
94
|
end
|
92
95
|
|
93
|
-
temp_filters = @user_query_filters.call(identity)
|
96
|
+
temp_filters = (@user_query_filters && @user_query_filters.call(identity)) || {}
|
94
97
|
temp = temp_filters[identity.user.id] || []
|
95
98
|
temp.each do |filter|
|
96
99
|
filters << JunglePath::Query::Filter.new(filter[:table_name], filter[:sub_select])
|
@@ -99,19 +102,48 @@ module JunglePath
|
|
99
102
|
filters
|
100
103
|
end
|
101
104
|
|
102
|
-
def
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
105
|
+
def get_table_filters(identity, no_cache=false)
|
106
|
+
filters = {}
|
107
|
+
|
108
|
+
temp_filters = (@role_table_filters && @role_table_filters[identity.role]) || []
|
109
|
+
temp_filters.each do |filter|
|
110
|
+
filters[filter[:table_name]] = filter
|
111
|
+
end
|
112
|
+
|
113
|
+
identity.authorization_filter.restrictions.each do |restriction|
|
114
|
+
temp_filters = (@restriction_table_filters && @restriction_table_filters[restriction]) || []
|
115
|
+
temp_filters.each do |filter|
|
116
|
+
filters[filter[:table_name]] = filter
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
temp_filters = (@user_table_filters && @user_table_filters[identity.user.id]) || []
|
121
|
+
temp_filters.each do |filter|
|
122
|
+
filters[filter[:table_name]] = filter
|
123
|
+
end
|
124
|
+
|
125
|
+
filters
|
126
|
+
end
|
127
|
+
|
128
|
+
def get_alternative_user_keys(user_id, no_cache=false)
|
129
|
+
cache_key = "#{user_id}_alt_keys"
|
130
|
+
alt_keys = @cache[cache_key]
|
131
|
+
if alt_keys == nil or no_cache
|
132
|
+
alt_keys = {}
|
133
|
+
alt_keys[:user_id] = user_id
|
134
|
+
if @alternative_user_key_queries
|
135
|
+
@alternative_user_key_queries.each do |alt_key_query|
|
136
|
+
ds = @db.base[alt_key_query[:query], user_id]
|
137
|
+
hash = ds.first
|
138
|
+
if hash
|
139
|
+
alt_key = hash[:alt_key]
|
140
|
+
alt_keys[alt_key_query[:name]] = alt_key
|
141
|
+
end
|
111
142
|
end
|
112
143
|
end
|
113
144
|
end
|
114
|
-
|
145
|
+
puts "alt_keys: #{alt_keys}."
|
146
|
+
alt_keys
|
115
147
|
end
|
116
148
|
end
|
117
149
|
end
|
@@ -98,6 +98,17 @@ module JunglePath
|
|
98
98
|
@user_query_filters = lambda do |identity| {
|
99
99
|
}
|
100
100
|
end
|
101
|
+
@role_table_filters = {
|
102
|
+
user: [
|
103
|
+
{table_name: :opportunity, replacement: :filter_opportunity}
|
104
|
+
]
|
105
|
+
}
|
106
|
+
@restriction_table_filters = {
|
107
|
+
me_related:[
|
108
|
+
{table_name: :opportunity, replacement: :filter_opportunity}
|
109
|
+
]
|
110
|
+
}
|
111
|
+
@user_table_filters = {}
|
101
112
|
end
|
102
113
|
|
103
114
|
def get_user(user_name, password, assume_identity=false, no_cache=false)
|
@@ -151,6 +162,33 @@ module JunglePath
|
|
151
162
|
|
152
163
|
filters
|
153
164
|
end
|
165
|
+
|
166
|
+
def get_table_filters(identity, no_cache=false)
|
167
|
+
filters = {}
|
168
|
+
|
169
|
+
temp_filters = @role_table_filters[identity.role] || []
|
170
|
+
temp_filters.each do |filter|
|
171
|
+
filters[filter[:table_name]] = filter
|
172
|
+
end
|
173
|
+
|
174
|
+
identity.authorization_filter.restrictions.each do |restriction|
|
175
|
+
temp_filters = @restriction_table_filters[restriction] or []
|
176
|
+
temp.each do |filter|
|
177
|
+
filters[filter[:table_name]] = filter
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
temp_filters = @user_table_filters[identity.user.id] or []
|
182
|
+
temp_filters.each do |filter|
|
183
|
+
filters[filter[:table_name]] = filter
|
184
|
+
end
|
185
|
+
|
186
|
+
filters
|
187
|
+
end
|
188
|
+
|
189
|
+
def get_alternative_user_keys(user_id, no_cache=false)
|
190
|
+
{}
|
191
|
+
end
|
154
192
|
end
|
155
193
|
end
|
156
194
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module JunglePath
|
2
2
|
module Authentication
|
3
3
|
class Identity
|
4
|
-
attr_accessor :remote_user, :remote_password, :user_name, :user, :key, :valid, :role, :authorization_filter, :query_filters, :
|
4
|
+
attr_accessor :remote_user, :remote_password, :user_name, :user, :key, :valid, :role, :authorization_filter, :query_filters, :table_filters
|
5
5
|
def to_s
|
6
|
-
"JunglePath::Authentication::Identity: {\n remote_user: #{@remote_user},\n remote_password: #{@remote_password},\n user_name: #{@user_name},\n user: #{@user},\n key: #{@key},\n valid: #{@valid},\n role: #{@role},\n authorization_filter: #{@authorization_filter}\n,query_filters: #{@query_filters}
|
6
|
+
"JunglePath::Authentication::Identity: {\n remote_user: #{@remote_user},\n remote_password: #{@remote_password},\n user_name: #{@user_name},\n user: #{@user},\n key: #{@key},\n valid: #{@valid},\n role: #{@role},\n authorization_filter: #{@authorization_filter}\n,query_filters: #{@query_filters},\ntable_filters: #{@table_filters},\nalternative_user_keys: #{@alternative_user_keys}}"
|
7
7
|
end
|
8
8
|
def to_h
|
9
9
|
{
|
@@ -16,9 +16,18 @@ module JunglePath
|
|
16
16
|
role: @role,
|
17
17
|
authorization_filter: @authorization_filter,
|
18
18
|
query_filters: @query_filters,
|
19
|
-
|
19
|
+
table_filters: @table_filters,
|
20
|
+
alternative_user_keys: @alternative_user_keys
|
20
21
|
}
|
21
22
|
end
|
23
|
+
def alternative_user_keys
|
24
|
+
return @alternative_user_keys if @alternative_user_keys
|
25
|
+
@alternative_user_keys = {user_id: @user.id} if @user
|
26
|
+
@alternative_user_keys
|
27
|
+
end
|
28
|
+
def alternative_user_keys= value
|
29
|
+
@alternative_user_keys = value
|
30
|
+
end
|
22
31
|
def to_hash
|
23
32
|
to_h
|
24
33
|
end
|
@@ -14,6 +14,24 @@ module JunglePath
|
|
14
14
|
def has_reference_to?(table_name)
|
15
15
|
@references.member?(table_name)
|
16
16
|
end
|
17
|
+
def build_call(identity, table)
|
18
|
+
parameters = identity.alternative_user_keys.select{|k, v| @parameters.include?(k)}.values.map{|n| convert_to_parameter(n)}.join(', ')
|
19
|
+
if parameters.length > 0
|
20
|
+
"#{table.table_name}(#{parameters})"
|
21
|
+
else
|
22
|
+
"#{table.table_name}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
def convert_to_parameter(value)
|
26
|
+
return value if value.class == Fixnum
|
27
|
+
return "'#{value}'" if value.class == String
|
28
|
+
return value if value.class == Float
|
29
|
+
return "'#{value.to_s}'::date'" if value.class == Date
|
30
|
+
return "'#{value.to_time.utc}'::timestamp'" if value.class == DateTime
|
31
|
+
return "'#{value.utc}'::timestamp'" if value.class == Time
|
32
|
+
return value.to_s if value.class == TrueClass or value.class == FalseClass
|
33
|
+
return "#{value}"
|
34
|
+
end
|
17
35
|
end
|
18
36
|
end
|
19
37
|
end
|
@@ -8,6 +8,7 @@ module JunglePath
|
|
8
8
|
module Query
|
9
9
|
class From
|
10
10
|
attr_reader :join_text, :table_name, :table_alias, :on_a_column_name, :on_b_alias, :on_b_column_name
|
11
|
+
attr_accessor :table_replacement_text
|
11
12
|
def initialize join_text, table_name, table_alias, on_a_column_name=nil, on_b_alias=nil, on_b_column_name=nil
|
12
13
|
@join_text = join_text
|
13
14
|
@table_name = table_name.to_sym
|
@@ -15,13 +16,16 @@ module JunglePath
|
|
15
16
|
@on_a_column_name = on_a_column_name
|
16
17
|
@on_b_alias = on_b_alias
|
17
18
|
@on_b_column_name = on_b_column_name
|
19
|
+
@table_replacement_text = nil
|
18
20
|
end
|
19
21
|
|
20
22
|
def to_s
|
23
|
+
table_name = @table_replacement_text || @table_name
|
24
|
+
table_name = "\"#{table_name}\"" unless table_name.class == String and table_name.include?('(')
|
21
25
|
if join_text == "" or join_text == nil
|
22
|
-
"
|
26
|
+
"#{table_name} #{@table_alias}"
|
23
27
|
else
|
24
|
-
" #{@join_text}
|
28
|
+
" #{@join_text} #{table_name} #{@table_alias} on #{@table_alias}.#{@on_a_column_name} = #{@on_b_alias}.#{@on_b_column_name}"
|
25
29
|
end
|
26
30
|
end
|
27
31
|
|
@@ -28,6 +28,7 @@ module JunglePath
|
|
28
28
|
|
29
29
|
if outer
|
30
30
|
hook_in_filters engine, select, from, where, sort, entity
|
31
|
+
hook_in_table_filters engine, select, from, where, sort, entity
|
31
32
|
sql = generate_sql(select, from, where, sort, entity, engine.apply_limit_offset_to_sql)
|
32
33
|
return sql, aliases, symbols, sort_ids, primary_key_field_count
|
33
34
|
else
|
@@ -120,6 +121,27 @@ module JunglePath
|
|
120
121
|
end
|
121
122
|
end
|
122
123
|
|
124
|
+
def self.hook_in_table_filters(engine, select, from, where, sort, entity)
|
125
|
+
puts "hook_in_table_filters QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFf"
|
126
|
+
#binding.pry
|
127
|
+
if engine.identity and engine.identity.table_filters
|
128
|
+
from.each do |frm|
|
129
|
+
filter = engine.identity.table_filters[frm.table_name]
|
130
|
+
if filter
|
131
|
+
puts "hook_in_table_filters: frm.table_name: #{frm.table_name}."
|
132
|
+
replacement_table = engine.tables[filter[:replacement]]
|
133
|
+
table_replacement_text = nil
|
134
|
+
if replacement_table.view
|
135
|
+
table_replacement_text = replacement_table.view.build_call(engine.identity, replacement_table)
|
136
|
+
else
|
137
|
+
table_replacement_text = "#{replacement_table.table_name}"
|
138
|
+
end
|
139
|
+
frm.table_replacement_text = table_replacement_text
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
123
145
|
def self.generate_sql(select, from, where, sort, entity, apply_limit_offset_to_sql)
|
124
146
|
lf = "\n"
|
125
147
|
indent_comma = ",\n "
|
data/lib/jungle_path/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jungle_path
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael VanZant
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- lib/jungle_path/app/run.sh
|
84
84
|
- lib/jungle_path/app/schemas/schema.rb
|
85
85
|
- lib/jungle_path/app/schemas/schema_all_in_one.rb
|
86
|
+
- lib/jungle_path/app/schemas/views.rb
|
86
87
|
- lib/jungle_path/app/services/email.rb
|
87
88
|
- lib/jungle_path/app/services/sms.rb
|
88
89
|
- lib/jungle_path/app/web_apps/public/index.html
|