Skip to content

Instantly share code, notes, and snippets.

class App < ActiveRecord::Base
attr_accessible :image, :name, :ram
has_many :versions
has_many :installations
belongs_to :user
validates_presence_of :name
mount_uploader :image, ApplogoUploader
def actual_version
versions.actual
%li{current_tab_if(:portal_home)}= link_to "All Sports Home", root_url
%li{current_tab_if(:debates)}= link_to 'Debates', debates_path
%li{current_tab_if(:blogs)}= link_to 'Articles', entries_path
%li{current_tab_if(:shows)}= link_to 'Shows', shows_path
%li{current_tab_if(:leaderboard)}= link_to 'Leaderboard', leaderboards_path
/%li{current_tab_if(:blogs_list)}= link_to "Blogs", blogs_path(:time=>'month')
- @leagues.each do |league|
- if (league.name =~ /other/i && league != @leagues.last)
- league.name = "More"; @leagues << league
- else
%li.top-level{:class => "#{active_league_if_params(league.name.downcase)} #{league.name.downcase} ", :style => "z-index:90"}
= link_to league.name, league, :class => 'navigation-link', :id => "#{league.name.downcase}-drop"
.top-level-content
%div.left-column
%ul
%li= link_to "&rsaquo; #{league.name} Home", league_path(league)
@Heavyblade
Heavyblade / vspec
Created October 9, 2012 16:35
vspec sample
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Test Suite xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SpecsDatabaseCleaner()
describe("Articles Behavior", function(){
it("should create an article", function(){
Factory.create("article");
var narticulos = cargarLista("ARTICULOS").listSize();
expect(1).toEqual(narticulos)
});
user = User.where(:email => "ron.evans@gmail.com")
user.projects.each { |project| project.trackers.each { |tr| tr.enable!; tr.perform_options.update_attributes(:valid_auth => true, :failed_count => 0); tr.tracked_projects { |tr_p| tr_p.update_attributes(:retry_count => 0) }}}
@Heavyblade
Heavyblade / specs
Created November 16, 2012 22:36
specs
➜ fanvsfan git:(master) ✗ rake spec:integration
/Users/cristianvasquez/.rvm/gems/ruby-1.9.3-p194@fanvsfan-193/gems/rspec-1.3.2/lib/spec/runner/options.rb:188: Use RbConfig instead of obsolete and deprecated Config.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/cristianvasquez/.rvm/gems/ruby-1.9.3-p194@fanvsfan-193/gems/rails-2.3.14/lib/rails/gem_dependency.rb:21.
/Users/cristianvasquez/.rvm/gems/ruby-1.9.3-p194@fanvsfan-193/gems/activesupport-2.3.14/lib/active_support/inflector.rb:3:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead.
DEPRECATION WARNING: require "activesupport" is deprecated and will be removed in Rails 3. Use require "active_support" instead. (called from <top (required)> at /Users/cristianvasquez/.rvm/gems/ruby-1.9.3-p194@fanvsfan-193/gems/activesupport-2.3.14/lib/activesupport.rb:2)
`include Capybara` is deprecated please use `include Capybara::DSL` instead.
....
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Example aliases
::Resque.queues.each do |queue|
if queue.classify.constantize.ancestors.include? ::Resque::Plugins::Loner::UniqueJob
::Resque.peek(queue, 0, -1).each do |job_payload|
hashes << ::Resque::Plugins::Loner::UniqueJob.redis_key(job_payload)
end
end unless queues_are_not_loners.include? queue
end
current_dir = File.dirname __FILE__
require File.join(current_dir, '..', 'unit_spec_helper.rb')
require 'ostruct'
require 'clutch/model_performable'
class PerformableTestClass
include ::MongoMapper::Document
include ::Clutch::Model::Performable
def initialize
var exportaciones = {
articulos: {
referencia: "Referencia",
name: "Nombre",
grupos: "Grupos",
"grupos.name": "Nombre Grupo",
"tarifas_iva.porcentaje": "Porc IVA",
precio_icluye_iva: "Precio incluye IVA",
exist: "Existencias",
f_ultima_comp: "Fecha Ultima Compra",