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 inject_binding = function (allBindings, key, value) { | |
//https://github.com/knockout/knockout/pull/932#issuecomment-26547528 | |
return { | |
has: function (bindingKey) { | |
return (bindingKey == key) || allBindings.has(bindingKey); | |
}, | |
get: function (bindingKey) { | |
var binding = allBindings.get(bindingKey); | |
if (bindingKey == key) { | |
binding = binding ? [].concat(binding, value) : value; |
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
ActiveRecord::Migration.class_eval do | |
def add_foreign_key_ignore_prefix(from_table, to_table, options = {}) | |
table_name_prefix = ActiveRecord::Base.table_name_prefix | |
ActiveRecord::Base.table_name_prefix = '' | |
add_foreign_key(from_table, to_table, options) | |
ActiveRecord::Base.table_name_prefix = table_name_prefix | |
end | |
def remove_foreign_key(from_table, options = {}) | |
table_name_prefix = ActiveRecord::Base.table_name_prefix |
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 AdminController < ApplicationController | |
layout 'admin' | |
def logs | |
log = File.join(Rails.root, "log", "#{Rails.env}.log") | |
@lines = `tail -1024 #{log}`.split(/\n/) | |
end | |
end |