Accessing model instance inside config block:
field :email do
formatted_value do
bindings[:object].user.email
end
end| # this goes in config/initializers | |
| APP_CONFIG = YAML.load(File.read(File.expand_path('../../app_constants.yml', __FILE__)))[Rails.env] |
| heroku addons:add pgbackups --remote staging | |
| heroku addons:add pgbackups --remote production | |
| heroku pgbackups:capture --remote production | |
| heroku pgbackups:restore DATABASE `heroku pgbackups:url --remote production` --remote staging |
Accessing model instance inside config block:
field :email do
formatted_value do
bindings[:object].user.email
end
end| ####################### | |
| # The following code goes in the distinction model | |
| ####################### | |
| # This is the hard-coding alternative to putting these values in the db | |
| DISTINCTION_AREAS = {'01' => 'moira.poe@yale.edu', '02' => 'nicole.chulick@yale.edu'} | |
| def area_email | |
| DISTINCTION_AREAS[self.area] | |
| end |
All packages in this directory will be automatically loaded
| <% @approval_states.each do |step| %> | |
| <li><%= link_to step.state, garden_meal_path(@garden_meal, garden_meal: { id: @garden_meal.id}, approval_state: step.state), method: :put %></li> | |
| <% end %> |
| #!/bin/bash | |
| # cleanup vim configs and start again with an empty install | |
| cd | |
| mv .vimrc .vimrc-old | |
| mv .vim .vim-old | |
| touch .vimrc | |
| mkdir .vim |
I hereby claim:
To claim this, I am signing this object:
| require 'rails_helper' | |
| describe StoreFront do | |
| describe '#shows_meal_label_line?' do | |
| let(:dc_geo) { FactoryGirl.build(:store_front, name: "DC") } | |
| let(:other_geo) { FactoryGirl.build(:store_front) } | |
| it 'true when multiple lines (aka DC)' do | |
| dc_geo.lines << FactoryGirl.create(:line, name: "Paleo") | |
| dc_geo.lines << FactoryGirl.create(:line, name: "Mix") |