Skip to content

Instantly share code, notes, and snippets.

up 20150117091501 Devise create admin users
up 20150117091505 Create active admin comments
up 20150120010407 ********** NO FILE **********
up 20150127002712 ********** NO FILE **********
up 20150127225430 Create products
up 20150127230158 Create categories
["image/jpg", "image/jpeg", "image/png", "image/gif"]
/^image\/(jpeg|png|gif|tiff|jpg)$/
def reset_password!(new_password, new_password_confirmation)
self.password = new_password
self.password_confirmation = new_password_confirmation
if valid?
clear_reset_password_token
after_password_reset
end
save
context "during the weekend" do
before do
before_open = Time.parse("01/04/2014 11:00 PST") # Saturday 11:00AM
while_open = Time.parse("01/04/2014 14:00 PST") # Saturday 2:00PM
after_closed = Time.parse("01/04/2014 18:00 PST") # Saturday 6:00PM
end
it "displays 'Phones Closed' before open" do
Time.stub(:now).returns(before_open)
expect { phone_lines_open?(before_open).to eq false }
end
class Event < ActiveRecord::Base
validates :title, :start_date, presence: true
validate :startdate_before_enddate
def startdate_before_enddate
if :end_date.present?
unless :start_date < :end_date
errors.add(:start_date, "must be before end date")
end
end
case
when p1[1] == "R" && p2[1] == "S" || p1[1] == "P" && p2[1] == "R" || p1[1] == "S" && p2[1] == "P" || p1[1] == p2[1]
then p1
else p2
end
Software Engineer
Software Engineering - MyCase | San Diego, CA, United States
We have small, high caliber teams developing easy-to-use solutions for our customers, and are looking for sharp Software Engineers to continue our rapid growth pace. If you enjoy building from back-end to client–side in an environment that values shared responsibility and continuous learning, apply today.
Responsibilities:
● Develop scalable, robust, and simple web-based solutions to solve complex business problems
● Formulate, implement, and evaluate algorithms and database queries to support SaaS scalability and stability.
<p>
<strong>Commenter:</strong>
<%= comment.commenter %>
</p>
<p>
<strong>Comment:</strong>
<%= comment.body %>
</p>
<!DOCTYPE html>
<html>
<head>
<title>Gastro</title>
<%= stylesheet_link_tag "application", media: "all",
"data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<title>Gastro</title>
<%= stylesheet_link_tag "application", media: "all",
"data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>