Skip to content

Instantly share code, notes, and snippets.

View gerhard's full-sized avatar

Gerhard Lazu gerhard

View GitHub Profile
jQuery('select[name*=product_type_id]').each(function() {
console.log(jQuery(this).val());
// these categories won't have products associated to them
// MAKE SURE the ids stay the same
if ( jQuery.inArray(jQuery(this).val(), ["4", "6", "7"]) )
// hide the product_id select parent, p in this case
jQuery(this).parent().next().hide();
});
// NOTE TO SELF
/Users/gerhardlazu/code/sitedirect/vendor/rails/activesupport/lib/active_support/dependencies.rb:262:in `load_missing_constant': Expected /Users/gerhardlazu/code/sitedirect/app/models/work_order_item.rb to define Work_order_item (LoadError)
from /Users/gerhardlazu/code/sitedirect/vendor/rails/activesupport/lib/active_support/dependencies.rb:468:in `const_missing'
from /Users/gerhardlazu/code/sitedirect/vendor/rails/activesupport/lib/active_support/dependencies.rb:480:in `const_missing'
from /Users/gerhardlazu/code/sitedirect/vendor/rails/activesupport/lib/active_support/inflector.rb:285:in `constantize'
from /Users/gerhardlazu/code/sitedirect/vendor/rails/activesupport/lib/active_support/inflector.rb:284:in `each'
from /Users/gerhardlazu/code/sitedirect/vendor/rails/activesupport/lib/active_support/inflector.rb:284:in `constantize'
from /Users/gerhardlazu/code/sitedirect/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb:143:in `constantize'
from /Users/gerhardlazu/code
it 'should include Google Analytics with multiple tracking codes if these have been provided' do
@it.google_analytics_include(['first_tracking_code', 'second_tracking_code']).should include('var pageTracker = _gat._getTracker("first_tracking_code");')
@it.google_analytics_include(['first_tracking_code', 'second_tracking_code']).should include('var secondTracker = _gat._getTracker("first_tracking_code");')
end
function imageReplace(selector) {
$(selector).each(function() {
string = $(this).text();
filename = string.toLowerCase().replace(/ /g, '-').replace(/([^0-9a-z-])/g,'');
$(this).html('');
});
}
def get_site_id
(get_site && get_site.id) || '0'
end
def get_site_name
get_site.name
end
def get_site_code
params[:site_code]
<li id="register" class="JGPmenu"><%= link_to register_name(@navigation), :site_code => get_site_code, :controller => '/sites/account', :action => 'register' unless logged_in? %></li>
<li id="login" class="JGPmenu"><%= link_to login_name(@navigation), :site_code => get_site_code, :controller => '/sites/account', :action => 'login' unless logged_in? %></li>
class CreateRouteFilters < ActiveRecord::Migration
def self.up
create_table :route_filters do |t|
t.column :site_id, :integer, :null => :true
t.column :internal_path, :string
t.column :external_path, :string
t.column :external_domain, :string
end
add_index(:route_filters, :internal_path)
add_index(:route_filters, :external_path)
it 'should include default stylesheets if asked to do so' do
@it.stylesheets_include(:default => true).should include("href=\"/stylesheets/sites/default_style.css\"")
@it.stylesheets_include(:default => true).should include("href=\"/stylesheets/sites/forms.css\"")
@it.stylesheets_include(:default => true).should include("href=\"/stylesheets/sites/icons.css\"")
@it.stylesheets_include(:default => true).should include("href=\"/stylesheets/sites/jgpsearch.css\"")
@it.stylesheets_include(:default => true).should include("href=\"/stylesheets/sites/ola.css\"")
@it.stylesheets_include(:default => true).should include("href=\"/stylesheets/sites/tables.css\"")
end
uninitialized constant CompaniesHelper
vendor/rails/activesupport/lib/active_support/dependencies.rb:439:in `load_missing_constant'
vendor/rails/activesupport/lib/active_support/dependencies.rb:77:in `const_missing'
vendor/rails/activesupport/lib/active_support/dependencies.rb:89:in `const_missing'
vendor/rails/activesupport/lib/active_support/inflector.rb:354:in `constantize'
vendor/rails/activesupport/lib/active_support/inflector.rb:353:in `each'
vendor/rails/activesupport/lib/active_support/inflector.rb:353:in `constantize'
vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'
vendor/plugins/acts_as_virtual_attribute/lib/acts_as_virtual_attribute.rb:69:in `acts_as_virtual_attribute'
Validation failed: Postcode has already been taken
vendor/rails/activerecord/lib/active_record/validations.rb:1021:in `save_without_dirty!'
vendor/rails/activerecord/lib/active_record/dirty.rb:87:in `save_without_transactions!'
vendor/rails/activerecord/lib/active_record/transactions.rb:150:in `save!'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
vendor/rails/activerecord/lib/active_record/transactions.rb:129:in `transaction'
vendor/rails/activerecord/lib/active_record/transactions.rb:138:in `transaction'
vendor/rails/activerecord/lib/active_record/transactions.rb:150:in `save!'
vendor/rails/activerecord/lib/active_record/transactions.rb:158:in `rollback_active_record_state!'