diff --git a/box.json b/box.json index f2c987db..250f9525 100644 --- a/box.json +++ b/box.json @@ -14,9 +14,9 @@ "shortDescription":"A ColdBox ORM Engine", "description":"A ColdBox ORM Engine", "scripts":{ - "format":"cfformat run dsl/**/*.cfc,extras/**/*.cfc,interceptors/**/*.cfc,models/**/*.cfc,tests/specs/**/*.cfc --overwrite", - "format:check":"cfformat check dsl/**/*.cfc,extras/**/*.cfc,interceptors/**/*.cfc,models/**/*.cfc,tests/specs/**/*.cfc --verbose", - "format:watch":"cfformat watch dsl/**/*.cfc,extras/**/*.cfc,interceptors/**/*.cfc,models/**/*.cfc,tests/specs/**/*.cfc", + "format":"cfformat run dsl/**/*.cfc,extras/**/*.cfc,models/**/*.cfc,tests/specs/**/*.cfc --overwrite", + "format:check":"cfformat check dsl/**/*.cfc,extras/**/*.cfc,models/**/*.cfc,tests/specs/**/*.cfc --verbose", + "format:watch":"cfformat watch dsl/**/*.cfc,extras/**/*.cfc,models/**/*.cfc,tests/specs/**/*.cfc", "generateAPIDocs":"rm .tmp --recurse --force && docbox generate mapping=quick excludes=test|/modules|ModuleConfig|QuickCollection strategy-outputDir=.tmp/apidocs strategy-projectTitle=Quick" }, "type":"modules", diff --git a/models/BaseEntity.cfc b/models/BaseEntity.cfc index 9395026e..65b4684c 100644 --- a/models/BaseEntity.cfc +++ b/models/BaseEntity.cfc @@ -423,7 +423,10 @@ component accessors="true" { * @doc_generic string * @return [string] */ - public array function retrieveAttributeNames( boolean asColumnNames = false, boolean withVirtualAttributes = false ) { + public array function retrieveAttributeNames( + boolean asColumnNames = false, + boolean withVirtualAttributes = false + ) { return variables._attributes.reduce( function( items, key, value ) { if ( value.virtual && !withVirtualAttributes ) { return items; @@ -2767,7 +2770,7 @@ component accessors="true" { variables._applyingGlobalScopes = true; applyGlobalScopes(); variables._applyingGlobalScopes = false; - variables._globalScopesApplied = true; + variables._globalScopesApplied = true; } return this; } @@ -2920,16 +2923,16 @@ component accessors="true" { if ( !isStruct( variables._meta ) || structIsEmpty( variables._meta ) ) { variables._meta = duplicate( variables._cache.getOrSet( "quick-metadata:#variables._mapping#", function() { - var util = createObject( "component", "coldbox.system.core.util.Util" ); - var meta = {}; - meta[ "originalMetadata" ] = util.getInheritedMetadata( this ); - meta[ "localMetadata" ] = getMetadata( this ); + var util = createObject( "component", "coldbox.system.core.util.Util" ); + var meta = {}; + meta[ "originalMetadata" ] = util.getInheritedMetadata( this ); + meta[ "localMetadata" ] = getMetadata( this ); if ( !meta[ "localMetadata" ].keyExists( "accessors" ) || meta[ "localMetadata" ].accessors == false ) { throw( - type = "QuickAccessorsMissing", + type = "QuickAccessorsMissing", message = 'This instance is missing `accessors="true"` in the component metadata. This is required for Quick to work properly. Please add it to your component metadata and reinit your application.' ); } @@ -3028,8 +3031,8 @@ component accessors="true" { public any function appendVirtualAttribute( required string name ) { if ( !variables._attributes.keyExists( retrieveAliasForColumn( arguments.name ) ) ) { variables._attributes[ arguments.name ] = paramAttribute( { - "name" : arguments.name, - "virtual": true + "name" : arguments.name, + "virtual" : true } ); variables._meta.attributes[ arguments.name ] = variables._attributes[ arguments.name ]; variables._meta.originalMetadata.properties.append( diff --git a/models/QuickBuilder.cfc b/models/QuickBuilder.cfc index 5ad4f5e4..c0dcb287 100644 --- a/models/QuickBuilder.cfc +++ b/models/QuickBuilder.cfc @@ -181,7 +181,10 @@ component extends="qb.models.Query.QueryBuilder" accessors="true" { } ); } ); - arguments.relationQuery = relation.addCompareConstraints().clearOrders().select( relation.raw( 1 ) ); + arguments.relationQuery = relation + .addCompareConstraints() + .clearOrders() + .select( relation.raw( 1 ) ); if ( listLen( arguments.relationshipName, "." ) > 1 ) { arguments.relationshipName = listRest( arguments.relationshipName, "." ); @@ -531,7 +534,10 @@ component extends="qb.models.Query.QueryBuilder" accessors="true" { } ); } ); q = relationship.whereExists( - relationship.addCompareConstraints( q.select( q.raw( 1 ) ) ).clearOrders().retrieveQuery() + relationship + .addCompareConstraints( q.select( q.raw( 1 ) ) ) + .clearOrders() + .retrieveQuery() ); } arguments.relationshipName = listRest( arguments.relationshipName, "." ); diff --git a/tests/specs/integration/BaseEntity/AttributeCastsSpec.cfc b/tests/specs/integration/BaseEntity/AttributeCastsSpec.cfc index 2ee16631..7b181b38 100644 --- a/tests/specs/integration/BaseEntity/AttributeCastsSpec.cfc +++ b/tests/specs/integration/BaseEntity/AttributeCastsSpec.cfc @@ -32,7 +32,7 @@ component extends="tests.resources.ModuleIntegrationSpec" appMapping="/app" { } ); it( "can use multiple attributes for casting", function() { - var user = getInstance( "User" ).findOrFail( 1 ); + var user = getInstance( "User" ).findOrFail( 1 ); expect( user.getAddress() ).notToBeNull(); var address = user.getAddress(); expect( address.fullStreet() ).toBe( "123 Elm Street" ); diff --git a/tests/specs/integration/BaseEntity/ReadOnlyPropertySpec.cfc b/tests/specs/integration/BaseEntity/ReadOnlyPropertySpec.cfc index b4c718fd..d49c9506 100644 --- a/tests/specs/integration/BaseEntity/ReadOnlyPropertySpec.cfc +++ b/tests/specs/integration/BaseEntity/ReadOnlyPropertySpec.cfc @@ -7,8 +7,7 @@ component extends="tests.resources.ModuleIntegrationSpec" appMapping="/app" { expect( link.getUrl() ).toBe( "http://example.com/some-link" ); expect( link.getCreatedDate() ).toBe( "2017-07-28 02:07:00" ); - link - .setUrl( "https://example.com/" ) + link.setUrl( "https://example.com/" ) .setCreatedDate( now() ) .save(); diff --git a/tests/specs/integration/GoodErrorMessagesSpec.cfc b/tests/specs/integration/GoodErrorMessagesSpec.cfc index 279507ef..30b5826a 100644 --- a/tests/specs/integration/GoodErrorMessagesSpec.cfc +++ b/tests/specs/integration/GoodErrorMessagesSpec.cfc @@ -55,7 +55,7 @@ component extends="tests.resources.ModuleIntegrationSpec" appMapping="/app" { expect( function() { getInstance( "EntityWithoutAccessors" ); } ).toThrow( - type = "QuickAccessorsMissing", + type = "QuickAccessorsMissing", regex = 'This instance is missing \`accessors\=\"true\"\` in the component metadata\. This is required for Quick to work properly\. Please add it to your component metadata and reinit your application\.' ); } );