This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Book::Application.routes.draw do | |
# DEVISE ------------------------------------------------------------------------------------------------------------- | |
devise_for :users, | |
:controllers => { | |
:registrations => "registrations", | |
:confirmations => 'confirmations', | |
:sessions => 'sessions', | |
:passwords => 'passwords'} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index | |
if APP_CONFIG['viral'] == true && !user_signed_in? | |
@signups = Signups.new | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def city | |
I18n.t(:city).map { |key, value| [value, key] } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |