Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Splits to use regex to match other parts of quick codebase #256

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions models/BaseEntity.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -2096,7 +2096,7 @@ component accessors="true" {
} else if ( !isSimpleValue( arguments.relationName ) ) {
related = arguments.relationName;
} else {
var parts = arguments.relationName.split( "[Aa][Ss]" );
var parts = arguments.relationName.split( "\s(?:[Aa][Ss]\s)?" );
related = variables._wirebox.getInstance( trim( parts[ 1 ] ) );
if ( arrayLen( parts ) > 1 ) {
related.withAlias( trim( parts[ 2 ] ) );
Expand All @@ -2118,7 +2118,7 @@ component accessors="true" {
} else if ( !isSimpleValue( throughEntityName ) ) {
throughEntity = throughEntityName;
} else {
var parts = throughEntityName.split( "[Aa][Ss]" );
var parts = throughEntityName.split( "\s(?:[Aa][Ss]\s)?" );
if ( variables._wirebox.containsInstance( trim( parts[ 1 ] ) ) ) {
throughEntity = variables._wirebox.getInstance( trim( parts[ 1 ] ) );
if ( arrayLen( parts ) > 1 ) {
Expand Down
4 changes: 2 additions & 2 deletions models/Relationships/Builders/HasManyDeepBuilder.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ component accessors="true" {
if ( !isNull( arguments.callback ) ) {
variables.through.append( function() {
var entity = "";
var parts = entityName.split( "[Aa][Ss]" );
var parts = entityName.split( "\s(?:[Aa][Ss]\s)?" );
var entity = variables.wirebox.getInstance( trim( parts[ 1 ] ) );
if ( arrayLen( parts ) > 1 ) {
entity.withAlias( trim( parts[ 2 ] ) );
Expand Down Expand Up @@ -78,7 +78,7 @@ component accessors="true" {
if ( !isNull( arguments.callback ) ) {
related = function() {
var entity = "";
var parts = relationName.split( "[Aa][Ss]" );
var parts = relationName.split( "\s(?:[Aa][Ss]\s)?" );
var entity = variables.wirebox.getInstance( trim( parts[ 1 ] ) );
if ( arrayLen( parts ) > 1 ) {
entity.withAlias( trim( parts[ 2 ] ) );
Expand Down
6 changes: 3 additions & 3 deletions models/Relationships/HasManyDeep.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ component
var segments = arguments.builder
.getQB()
.getTableName()
.split( "[Aa][Ss]" );
.split( "\s(?:[Aa][Ss]\s)?" );
var alias = segments[ 2 ] ?: "";

var chainLength = variables.throughParents.len();
Expand Down Expand Up @@ -213,7 +213,7 @@ component
var segments = arguments.builder
.getQB()
.getTableName()
.split( "[Aa][Ss]" );
.split( "\s(?:[Aa][Ss]\s)?" );
var alias = segments[ 2 ] ?: "";

var foreignKeys = [];
Expand All @@ -239,7 +239,7 @@ component
var segments = arguments.builder
.getQB()
.getTableName()
.split( "[Aa][Ss]" );
.split( "\s(?:[Aa][Ss]\s)?" );
var alias = segments[ 2 ] ?: "";

var localKeys = [];
Expand Down
Loading