Skip to content

Instantly share code, notes, and snippets.

View rubytastic's full-sized avatar

rubytastic rubytastic

View GitHub Profile
namespace :db do
desc "Populate Users Table with images from /public/feedimg"
task :populate => :environment do
require "populator"
require "faker"
User.populate 1 do |user|
user.username = Faker::Name.first_name.downcase
user.email = Faker::Internet.user_name + "@myhost.com".downcase
user.confirmed_at = DateTime.now
Book::Application.routes.draw do
# DEVISE -------------------------------------------------------------------------------------------------------------
devise_for :users,
:controllers => {
:registrations => "registrations",
:confirmations => 'confirmations',
:sessions => 'sessions',
:passwords => 'passwords'}
We couldn’t find that file to show.
beta = Beta.new
beta.name = "name"
beta.email = "email"
beta.save
ArgumentError (wrong number of arguments (1 for 0)):
app/controllers/viral_controller.rb:6:in `new'
app/controllers/viral_controller.rb:6:in `join'
config/initializers/logging.rb:6:in `call_with_quiet_assets'
create_table "beta", :force => true do |t|
t.string "code"
t.integer "used"
t.string "email"
t.integer "count"
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "send"
end
Snapshot on 2013-01-15 09:34:38
Database: ectasio_development
beta
Field21Type Allow Null Default Value
id int(11) No
code varchar(255) Yes
def index
if APP_CONFIG['viral'] == true && !user_signed_in?
@signups = Signups.new
end
end
Started GET "/signups/new" for 127.0.0.1 at 2013-01-17 10:01:15 +0100
Processing by SignupsController#new as HTML
Completed 500 Internal Server Error in 10ms
ArgumentError (wrong number of arguments (1 for 0)):
app/controllers/signups_controller.rb:27:in `new'
app/controllers/signups_controller.rb:27:in `new'
def city
I18n.t(:city).map { |key, value| [value, key] }
end
if params[:code].present?
# increase beta.shared where code = params[:code]
@beta = Betum.where(:code => params[:code]).first
if @beta
@beta.update_all("shared = shared + 1", ["code >= ?", params[:code]])
end
end