...of lessons that you finished. This way you get periodic updates about your progress. Order of lessons Work through the cards in the listed order. When you're finished with...
...necessarily) only happen when trying to update or otherwise lock several rows in different order. Solving deadlocks is potentially complicated, so here are a few pointers: MySQL should always detect...
...after pagination: # does not work @contracts = @contracts.reject {...} # works @contracts.reject! {...} YAML fixes Change # old date: order: [ :day, :month, :year ] # new date: order: - :year - :month - :day Also see Upgrade from Ruby...
...special tag message" A normal git push will not push the tag. So in order to publish your (local) tags, you have to git push --tags Check if a tag...
...with two bundlers being loaded (an old one and a new one, in that order, doesn't work well). https://github.com/phusion/passenger/issues/2409#issuecomment-1029361123
...existing rows with ascending numbers. Furthermore these numbers should be generated by a special order. In order to achieve that you could do the following: execute "SET @pos := 0;"
...UPDATE pages SET position = ( SELECT @pos := @pos + 1 ) ORDER BY updated_at DESC...
...the certificate. It's also possible that the certificate chain is in the wrong order. Make sure that the server certificate is the first. This is also necessary for nginx...
...t magically load themselves from disk. Production All files are loaded in a deterministic order once the server boots. Take this example with some constants referencing each other: # app/models/contract/document/uploader.rb
...Document::Uploader. In development this can happen randomly, as you never know in which order the files are autoloaded. If the autoload mechanism has already loaded app/models/document/uploader.rb, a constant lookup...
...by default (see official Documentation). However, it only cleans up releases, not assets. In order to clean up assets, you can use capistrano-rails. Just require 'capistrano/rails' in Capfile and...
...Many times you would use scope options, like this: users = User.scoped( :joins => 'INNER JOIN orders joined_orders ON users.id = joined_orders.user_id', :conditions => [ 'joined_orders.date BETWEEN ? AND ?', start_date, end_date ],
...user IDs by selecting only from the users table: users = User.scoped( :joins => 'INNER JOIN orders joined_orders ON users.id = joined_orders.user_id', :conditions => [ 'joined_orders.date BETWEEN ? AND ?', start_date, end_date ],
Let's say you have two XML strings that are ordered differently but you don't care about the order of attributes inside containers: a = ' batman secret ' b = ' secret batman...
xml_parser.parse(a) => {:authenticate=>{:user=>"batman", :password=>"secret"}} xml_parser.parse(a) == xml_parser.parse(b) => true Note: order in XML can be important (e.g. XHTML). For cases where it's not, you can...
...the necessary parameters instead. that is for example caused by url_for( :overwrite_params => { :order => 'name', :dir => 'asc' } ) you can fix this by using params.merge {:my_param_to_overwrite => 'foo...
...To fix the example above the code could look like: url_for( params.merge { :order => 'name', :dir => 'asc' } ) Note: link_to uses url_for internally, so you can can use params.merge...
...In most cases it is sufficient to delete and recreate the local database in order to import the dump. If any problems occur, proceed as follows: 1. Figure out the...
Stick.shuffled.first Or, if you prefer something smaller: class Stick named_scope :shuffled, :order => 'RAND()' end Note however that you should never order by RAND() on tables that may...
...If you use the ARRAY[] syntax, you'll need to add a type in order to perform operations with e.g. a string array column: ARRAY['one', 'two']::varchar[].
...configuration) at some point Capistrano tries to check out code from your repository. In order to do so, Capistrano connects to your repository server from the application server you're...
Ruby offers monkey patching methods in order to change the behavior of a library if there's no better way. We can call the method we're overriding inside our...
...is installed (locally, don't put it into your Gemfile). Run geordi commit in order to set up API access for Pivotal Tracker. Put the tracker_api Gem into your...
...with value "bar". It is actually just a String without any magic powers. In order to read a cookie's value, you need to parse the string: document.cookie.match(/hello...
...collection of records for your select2 input, you can populate it via AJAX in order to not pollute your HTML with lots of elements. All you have to do is...
That’s why it’s important to find a way to order and maintain your routes. See: Clean your Rails routes: grouping Sometimes the routes.rb grows very...
...always bypass the pre-commit hook by committing with the --no-verify option.) In order to have git fix whitespace on lines you edited before each commit, append the following...
...i want the word to break. This is only done in text nodes in order to not break url's in link-tags. up.compiler('[break-long-words]', (element) => { const wordBreaks...
...seconds. You probably want to reduce these numbers significantly in order to detect dead connections in a timely fashion, but you can do this in your application code (no need...