Skip to content

Commit

Permalink
Tableless models should not require dataSourceName #351
Browse files Browse the repository at this point in the history
  • Loading branch information
scahyono committed Sep 8, 2014
1 parent aacf32b commit a0e95a4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
9 changes: 8 additions & 1 deletion wheels/CHANGELOG
@@ -1,4 +1,11 @@
1.3.1
2.0

Bug Fixes
=========

* Tableless models should not require dataSourceName #351 [Jeremy Keczan, Singgih Cahyono]

1.3.1 (08/25/2014)

Bug Fixes
=========
Expand Down
6 changes: 3 additions & 3 deletions wheels/model/initialization.cfm
Expand Up @@ -61,11 +61,11 @@
// make sure that the tablename has the respected prefix
table(getTableNamePrefix() & tableName());
// load the database adapter
variables.wheels.class.adapter = $createObjectFromRoot(path="#application.wheels.wheelsComponentPath#", fileName="Connection", method="init", datasource="#variables.wheels.class.connection.datasource#", username="#variables.wheels.class.connection.username#", password="#variables.wheels.class.connection.password#");
if (!IsBoolean(variables.wheels.class.tableName) || variables.wheels.class.tableName)
{
// load the database adapter
variables.wheels.class.adapter = $createObjectFromRoot(path="#application.wheels.wheelsComponentPath#", fileName="Connection", method="init", datasource="#variables.wheels.class.connection.datasource#", username="#variables.wheels.class.connection.username#", password="#variables.wheels.class.connection.password#");
// get columns for the table
loc.columns = variables.wheels.class.adapter.$getColumns(tableName());
Expand Down
@@ -1,8 +1,14 @@
<cfcomponent extends="standard_validations">

<cffunction name="setup">
<cfset oldDataSourceName = application.wheels.dataSourceName>
<cfset application.wheels.dataSourceName = "">
<cfset StructDelete(application.wheels.models, "UserTableless", false)>
<cfset loc.user = model("UserTableless").new()>
</cffunction>

<cffunction name="teardown">
<cfset application.wheels.dataSourceName = oldDataSourceName>
</cffunction>

</cfcomponent>

0 comments on commit a0e95a4

Please sign in to comment.