This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
def from_json | |
ActiveSupport::JSON.decode(self) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creating a new git repository based on the subdirectory of an existing repository | |
# Got this from: http://stackoverflow.com/questions/359424/detach-subdirectory-into-separate-git-repository | |
git clone --no-hardlinks project327 compass | |
cd compass | |
git filter-branch --subdirectory-filter bloomfire-compass HEAD -- --all | |
git reset --hard | |
git gc --aggressive | |
git prune |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;WatinSearchHelper = function ($) { | |
var earTagId = 1; | |
var getElementId = function (cssSelector) { | |
var resultId = "_no_element_"; | |
var el = $(cssSelector); | |
if (el.length > 0) { | |
var firstEl = el[0]; | |
if (firstEl.id == "") { | |
// Give this element a contrived id so we can find it directly from the WatiN side: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using WatiN.Core; | |
namespace WatinSearchHelper | |
{ | |
public static class BrowserExtensions | |
{ | |
public static Element FindViaJQuery(this Browser browser, string cssSelector) | |
{ | |
var elementId = browser.Eval(string.Format("WatinSearchHelper.getElementId(\"{0}\")", cssSelector)); | |
return browser.Element(Find.ById(elementId)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var link = browser.FindViaJQuery(“.search_results.businesses .result a:contains(‘Applebees’)”).Click(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace UnitTests | |
{ | |
public class FullMigrationTest | |
{ | |
public static string[] AllExpectedTables = new[] | |
{ | |
"BlogPost", | |
"Attachment", | |
"Photo", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace UnitTests.TestHelpers | |
{ | |
public class MigrationTestHelper | |
{ | |
public static readonly string Provider = "SqlServer"; | |
public static readonly string ConnectString = "Database=myapp_test;Data Source=localhost;User Id=myUser;Password=abc123"; | |
public static Migrator.Migrator GetMigrator() | |
{ | |
var assembly = Assembly.GetAssembly(typeof(BootstrapAspDotNetAuthTables)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MvcApplication : System.Web.HttpApplication | |
{ | |
protected void Application_Start() | |
{ | |
var assembly = Assembly.GetAssembly(typeof(MvcApplication)); | |
var connectString = ConfigurationManager.ConnectStrings(“ApplicationServices”).ConnectionString; | |
var migrator = new Migrator(“SqlServer”, connectString, assembly); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project DefaultTargets="All" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<UsingTask AssemblyFile="Lib\Migrator.MSBuild.dll" TaskName="Migrator.MSBuild.Migrate" /> | |
<PropertyGroup> | |
<To>-1</To> | |
<Env>Development</Env> | |
<ConnectionString Condition="'$(Env)'=='Development'">Database=myapp_dev;Data Source=localhost;User Id=myuser;Password=abc123</ConnectionString> | |
<ConnectionString Condition="'$(Env)'=='Test'">Database=myapp_test;Data Source=test_db_server;User Id=myuser;Password=abc123</ConnectionString> | |
<ConnectionString Condition="'$(Env)'=='Production'">Database=myapp_prod;Data Source=prod_db_server;User Id=myuser;Password=abc123</ConnectionString> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated. | |
The statement has been terminated. | |
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) | |
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) | |
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() | |
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) | |
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) | |
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) | |
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result |
OlderNewer