Skip to content

Instantly share code, notes, and snippets.

@komba
komba / poster.json
Last active September 29, 2025 15:41
{
"barcode": "",
"category_name": "Top screen",
"unit": "",
"cost": "0",
"cost_netto": "0",
"fiscal": "0",
"hidden": "0",
"menu_category_id": "0",
"workshop": "0",
require_gcc
install_package "ruby-2.0.0-p648" "http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p648.tar.gz"
require 'spec_helper'
require 'rake'
describe 'Admins Rake task' do
let(:rake) { Rake::Application.new }
context 'adding and listing admins' do
before(:each) do
Rake.application = rake
load Rails.root + 'lib/tasks/admins.rake'
@komba
komba / routes.rb
Created January 18, 2011 13:29
dot in url
map.company_profile 'company/:company_name', :controller => 'users', :action => 'company_profile', :requirements => {:company_name => /.*/}
# Enable dot in :company_name param
@komba
komba / credit.rb
Created January 11, 2011 14:26
OOP =(
class Credit < ActiveRecord::Base
belongs_to :user
attr_accessible :is_unlimited?
def is_unlimited?
self.user.subscription ? ((self.user.subscription.plan.id == 4) ? true : false) : false
end
# rewrite standart method