Skip to content

Instantly share code, notes, and snippets.

View szymon-przybyl's full-sized avatar

Szymon Przybył szymon-przybyl

View GitHub Profile
When /^I create a movie Caddyshack in the Comedy genre$/ do
visit movies_path
click_link 'Add Movie'
fill_in 'Title', :with => 'Caddyshack'
select '1980', :from => 'Release Year'
check 'Comedy'
click_button 'Save'
end
validate :validate_colors
def validate_colors
pattern = /^[\da-f]{6}$/
primary_status = primary_color =~ pattern
secondary_status = secondary_color =~ pattern
errors.add(:primary_color, @@default_error_messages[:format]) unless primary_status
errors.add(:secondary_color, @@default_error_messages[:format]) unless secondary_status
if primary_status && secondary_status
if Color.similar?(primary_color, secondary_color)
Error during failsafe response: deadlock; recursive locking
<internal:prelude>:8:in `lock'
<internal:prelude>:8:in `synchronize'
/home/szymon/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.3/lib/active_support/buffered_logger.rb:101:in `flush'
/home/szymon/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.3/lib/active_support/buffered_logger.rb:125:in `auto_flush'
/home/szymon/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.3/lib/active_support/buffered_logger.rb:66:in `add'
/home/szymon/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.3/lib/active_support/buffered_logger.rb:77:in `fatal'
/home/szymon/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.3/lib/action_dispatch/middleware/show_exceptions.rb:132:in `block in log_error'
/home/szymon/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.3/lib/active_support/deprecation/reporting.rb:16:in `silence'
/home/szymon/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.3/lib/action_dispatch/middleware/show_exceptions.rb:128:in `log_error'
@szymon-przybyl
szymon-przybyl / en.yml
Created February 13, 2011 21:15
what should i type here? maybe some secret code?
activerecord:
attributes:
user:
email: 'Email address'
password: 'Password'
password_confirmation: 'Confirm password'
name: 'Your name'
errors:
club:
similar_colors: 'You have to choose two different colors'