Skip to content

Instantly share code, notes, and snippets.

View rubystar's full-sized avatar

Venkata Reddy Bhavanam rubystar

View GitHub Profile
@rubystar
rubystar / gist:5291955
Created April 2, 2013 12:48
import mpr
class Plan < ActiveRecord::Base
include Roo
def self.import
s = Excelx.new("#{Rails.root}/db/data/simple_media_plan.xlsx")
table_start_row_no = s.first_row
table_end_row_no = s.last_row
# Find the start and end row of the table
s.first_row.upto(s.last_row) do |line|
@rubystar
rubystar / gist:5107734
Created March 7, 2013 12:34
conflicts html generation code to helpers
[venkatab@pnwsdes053 redzone]$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: RZ-3594 - As a developer, I want to develop and implement a strategy for removing html generation code from models
Using index info to reconstruct a base tree...
<stdin>:83: trailing whitespace.
("On #{adjustment.created_at.to_s(:date)}, #{adjustment.user.name} changed #{adjustment.stat_column} from #{adjustment.formatted_original_value} to #{adjustment.formatted_value} for these dimensions: " +
<stdin>:86: trailing whitespace.
<stdin>:182: trailing whitespace.
@rubystar
rubystar / gist:4594784
Last active December 11, 2015 11:38
Rails fails to save joining model
[venkatab@pnwsdes053 redzone]$ rails c
/home/local/PENNYWISE/venkatab/.rvm/gems/ruby-1.9.3-p194@redzone/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require': iconv will be deprecated in the future, use String#encode instead.
Loading development environment (Rails 3.2.11)
[1] pry(main)> gt = c.geo_targets.build({"name" => "Venkat is testitnee"})
NameError: undefined local variable or method `c' for main:Object
from (pry):1:in `__pry__'
[2] pry(main)> c = Campaign.first
@rubystar
rubystar / gist:4336445
Created December 19, 2012 12:49
capistrano deployment staging
-sh-4.2$ bundle exec cap staging deploy:migrations
* 2012-12-19 18:09:50 executing `staging'
triggering start callbacks for `deploy:migrations'
* 2012-12-19 18:09:50 executing `multistage:ensure'
* 2012-12-19 18:09:50 executing `deploy:migrations'
* 2012-12-19 18:09:50 executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote git@github.com:venkatab/redzone.git staging"
command finished in 4882ms
* executing "if [ -d /home/redzone/deploy/redzone/shared/cached-copy ]; then cd /home/redzone/deploy/redzone/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard e2d132f97dbcc04fc45a3fd464347e651785775a && git clean -q -d -x -f; else git clone -q git@github.com:venkatab/redzone.git /home/redzone/deploy/redzone/shared/cached-copy && cd /home/redzone/deploy/redzone/shared/cached-copy && git checkout -q -b deploy e2d132f97dbcc04fc45a3fd464347e651785775a; fi"
@rubystar
rubystar / RZ-3580 -- Resolve automated test failures
Created November 12, 2012 13:19
RZ-3580 -- Resolve automated test failures
cucumber features/am_campaign.feature:11: Passing without any fix
cucumber features/au_invoices.feature:27: Fixed
cucumber features/au_invoices.feature:53: Fixed
cucumber features/au_invoices.feature:73: Fixed
cucumber features/au_invoices.feature:91: Fixed
cucumber features/au_invoices.feature:108: Fixed
cucumber features/au_invoices.feature:152: Fixed
cucumber features/mb_campaign_site_allocations.feature:136: Passing without any fix
cucumber features/nao_blocked_referrers.feature: Not Fixed
@rubystar
rubystar / UI rebasing on 25th October
Created October 25, 2012 06:29
UI rebasing on 25th October
-sh-4.2$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: RZ-3203 - As a developer, I want to migrate the remaining ERB views to HAML
Using index info to reconstruct a base tree...
<stdin>:790: trailing whitespace.
<stdin>:3118: trailing whitespace.
<stdin>:6204: trailing whitespace.
@rubystar
rubystar / One more rebase UI migration on master
Created October 23, 2012 06:20
One more rebase UI migration on master
-sh-4.2$ git merge upstream/master
Updating a19d637..6758a23
Fast-forward
app/controllers/media_plan_requests_controller.rb | 9 ++++++++-
app/controllers/payables_controller.rb | 2 +-
app/controllers/receivables_controller.rb | 1 +
app/helpers/application_helper.rb | 8 ++++++++
app/models/payable.rb | 1 +
app/models/receivable.rb | 4 ++++
app/views/advertisers/_form.html.haml | 2 +-
@rubystar
rubystar / failing cukes perf improvement
Created October 12, 2012 06:35
failing cukes perf improvement
cucumber features/am_campaign.feature:17 # Scenario: As an Account manager I must be able to create a Campaign and create a new client
cucumber features/am_campaign.feature:196 # Scenario: As an Account Manager, when defining a campaign's dimensions, I want there to be 3 custom dimensions I can add values to.
budget allocation
cucumber features/am_campaign_dashboard.feature:41 # Scenario: As the user, when viewing the campaign dashboard, I want to see a summary of all budget allocations
cucumber features/am_campaign_dashboard.feature:72 # Scenario: As the user, when viewing the campaign dashboard, I want to see links to the advertiser summary report
cucumber features/am_campaign_dashboard.feature:94 # Scenario: As the user, when viewing the campaign dashboard, I want to see links to the advertiser daily report
cucumber features/au_invoices.feature:53 # Scenario: As an accountant, I want to be able to preview the generated invoices before syncing to QB
cucumber features/hr_user_hourly_rates.feature:15 # Scenar
@rubystar
rubystar / files couldn't find in UI
Created October 9, 2012 11:25
files couldn't find in UI
budget_allocations
_performance: couldn't find in UI
site_allocations
_readonly_table: couldn't find in UI
campaign_sites
_readonly_table: couldn't find in UI
ads
@rubystar
rubystar / additional cucumber failures on rails upgrade
Created September 7, 2012 14:45
Additional failures on rails 3.2 and ruby 1.9.3 compared to rails 3.0.10 and ruby 1.87
cucumber features/am_campaign.feature:11 # Scenario: As an Account Manager, I can view Campaigns for departments to which I belong
cucumber features/am_campaign_budget_allocations.feature:283 # Scenario: As an Account Manager, when creating a budget allocation, I can pick the specific dimension values for this allocation
cucumber features/am_campaign_budget_allocations.feature:355 # Scenario: As an Account Manager, I want a dynamically updated notice informing me how many ads and site allocations will belong to the budget allocation
cucumber features/am_campaign_dashboard.feature:27 # Scenario: As the user, when viewing the campaign dashboard, I want to view a summary of the campaign's core values
cucumber features/am_campaign_dashboard.feature:41 # Scenario: As the user, when viewing the campaign dashboard, I want to see a summary of all budget allocations
cucumber features/am_campaign_dashboard.feature:72 # Scenario: As the user, when viewing the campaign dashboard, I want to see links to the advertiser sum