diff --git a/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs b/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs index 0e34c83..c34c7e5 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs @@ -1,6 +1,6 @@

Queries

- {{combo-box valueAttribute="id" value=selectedQueryId nameProperty="listName" content=content castInteger="true"}} + {{combo-box valueAttribute="id" value=selectedQueryId nameProperty="listName" content=content castInteger="true" nameChanges="true"}} {{d-button action="showCreate" icon="plus" class="no-text"}} {{d-button action="importQuery" label="explorer.import.label" icon="upload"}}
diff --git a/plugin.rb b/plugin.rb index 3a1e0c1..47464c9 100644 --- a/plugin.rb +++ b/plugin.rb @@ -47,9 +47,13 @@ after_initialize do # (The first name is $0.) def self.extract_params(sql) names = [] - new_sql = sql.gsub(/:([a-z_]+)/) do |_| - names << $1 - "$#{names.length - 1}" + new_sql = sql.gsub(/(:?):([a-z_]+)/) do |_| + if $1 == ':' # skip casts + $& + else + names << $1 + "$#{names.length - 1}" + end end {sql: new_sql, names: names} end