Skip to content

Instantly share code, notes, and snippets.

View mhfs's full-sized avatar

Marcelo Silveira mhfs

View GitHub Profile
# lib/tw_date_picker.rb
module TwDatePicker
module TwDatePickerHelper
end
module AssetTagHelper
def tw_date_picker_includes(options = {})
javascript_include_tag('tw_date_picker', options)
end
@company = Company.find(@ticket.company_id) ||= @companies.first
#/Users/mhfs/Sites/supporter/app/controllers/tickets_controller.rb:140: syntax error, unexpected tOP_ASGN, #expecting ')'
#...y.find(@ticket.company_id) ||= @companies.first)
# ^
I18n::InvalidPluralizationData in Memberships#create
Showing app/views/shared/_form_error.html.erb where line #1 raised:
translation data {:service_item=>"Ítem de Serviço", :ticket=>"Ticket", :attachment=>"Anexo", :profile=>"Perfil", :account=>"Conta", :company=>"Empresa", :membership=>"funciona porra", :user=>"Usuário", :business_unit=>"Unidade de Negócio", :membershipable=>"Permissionável"} can not be used with :count => 1
Extracted source (around line #1):
1: <%= error_messages_for :object => form_error %>
activerecord:
models:
attachment: "Anexo"
account: "Conta"
company: "Empresa"
business_unit: "Unidade de Negócio"
service_item: "Ítem de Serviço"
ticket: "Ticket"
membership: "funciona porra"
profile: "Perfil"
==> production.log <==
# Logfile created on Tue Sep 08 10:50:08 -0700 2009
Processing HomepageController#index (for 201.82.129.151 at 2009-09-08 10:51:17) [GET]
Parameters: {"action"=>"index", "controller"=>"homepage"}
Rendering template within layouts/application
Rendering homepage/index
ActionView::TemplateError (can't convert nil into String) on line #11 of app/views/layouts/application.html.haml:
8: = stylesheet_link_tag 'application'
Feature: Login
To ensure the safety of the application
A regular user of the system
Must authenticate before using the app
Scenario Outline: Failed Login
Given the user "known_user"
When I go to the main page
ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => "smtp.gmail.com",
:port => 587,
:domain => "twiva.com.br",
:authentication => :plain,
:user_name => "noreply@twiva.com.br",
:password => 'mypass'
}
class ContactsController < ApplicationController
def index
@contacts = current_user.contacts.paginate :page => params[:page]
end
def show
@contact = current_user.contacts.find(params[:id])
end
def new
class Asset < ActiveRecord::Base
attr_accessible :caption, :attachment, :attachment_file_name, :attachment_content_type, :attachment_file_size, :attachment_updated_at
has_attached_file :attachment,
:styles => { :medium => "300x300>",
:thumb => "100x100>" }
validates_attachment_presence :attachment
validates_presence_of :account_id, :caption
Factory.define :account do |ac|
ac.sequence(:name) { |n| "Account#{n}" }
ac.sequence(:subdomain) { |n| "subdomain#{n}" }
ac.users { |a| [a.association(:user, :account_id => ac.object_id), a.association(:user, :account_id => ac.object_id)] }
end
Factory.define :user do |u|
u.sequence(:name) { |n| "John Doe #{n}" }
u.sequence(:username) { |n| "user#{n}" }