- Sign in/Sign up
- Claim
- Unclaim
- Reassign
- Mute conversations
- Close issue/conversation
This file contains 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
class Campaign < ActiveRecord::Base | |
belongs_to :user | |
has_many :perks | |
accepts_nested_attributes_for :perks, :reject_if => :all_blank, :allow_destroy => true | |
has_attached_file :image, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "/images/:style/missing.png" | |
validates_attachment_content_type :image, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif"] | |
has_attached_file :photo_id, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "/images/:style/missing.png" | |
validates_attachment_content_type :image, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif"] |
This file contains 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
{ | |
"font_size": 10.0, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
"tab_size": 2, | |
"theme": "Soda Dark.sublime-theme", | |
"translate_tabs_to_spaces": true | |
} |
This file contains 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
RULES = { "A" => 50, | |
"B" => 30, | |
"C" => 20, | |
"D" => 15 | |
} | |
DISCOUNTS = { "A" => [3, 20], | |
"B" => [2, 15] | |
} |
This file contains 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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
This file contains 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
--color | |
--require spec_helper | |
--format documentation |
This file contains 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
ActiveRecord cheat sheet / EXAMPLES | |
INSTALL | |
======= | |
$ gem install activerecord | |
in GEMFILE: gem ‘activerecord’ | |
REQUIRE | |
======= | |
require ‘active_record’ |
This file contains 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
class CheckoutMachine | |
PRODUCT_LIST = { | |
123 => { product: :chips, price: 200 }, | |
456 => { product: :salsa, price: 100 }, | |
789 => { product: :wine, price: 1000 }, | |
111 => { product: :cigarettes, price: 550 }, | |
000 => { product: :bonus_card, price: nil } | |
} | |
def initialize |
Day #1
Discussed:
- Concerns/Mixins vs. Explicit classes for business logic
- Cons for Concerns:
- Concern will grow in responsibility and behavior
- Concerns across repos are hard to manage
- "floating" methods are implicit
- Poor naming standards across teams. The behavior encompassed in a concern is not explicit. e.g. CaseStatusConcern could be improved by CaseStatusFetchable
- Cons for Concerns:
- Pros for Concerns:
This file contains 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
{ | |
"Thin Strokes" : 2, | |
"Working Directory" : "\/Users\/gpespn", | |
"Prompt Before Closing 2" : 0, | |
"Selected Text Color" : { | |
"Green Component" : 0.6352941393852234, | |
"Blue Component" : 0.6980392336845398, | |
"Red Component" : 0.6078431606292725 | |
}, | |
"Rows" : 25, |
OlderNewer