...a low-level Ruby message like Fix: "undefined method `bytesize' for #" or the standard Rails error box. You will not get an exception notification per e-mail or Airbrake.
ActiveModel::Errors is used to handle validation errors on Rails objects. If you inspect an instance, it feels like a hash (to be more precise, it inherits from Hash):
Enumerable#grep_v excludes from the result set. It's similar to Rails' #reject: ['foo', 1, 'bar', {}].grep String # => ['foo', 'bar'] ['foo', 1, 'bar', {}].grep_v String...
...user symbol in the hash of inclusions turned into a "user" string.\ This breaks Rails' loading of associations as it will complain about calling nil.name or nil.macro while it tries...
...Otherwise add database_cleaner to your *Gemfile`. This lets you say this from the Rails console: DatabaseCleaner.strategy = :truncation DatabaseCleaner.clean You can package this into a nice little Rake task by...
...can e.g. clean the test database by saying on the shell: rake db:clean RAILS_ENV=test If you are using the parallel_tests gem, the task is aware and...
ActiveSupport::Memoizable will be removed from Rails and has a lot of strange caveats that will ruin your day. Use the Memoizer gem instead. It works in all past and...
...future Railses and has none of the annoying "features" of ActiveSupport::Memoizable. It just does memoization and does it well. The syntax is similiar also: class Foo include Memoizer
...you set both a record's association and that association's foreign key attribute, Rails does not realize you are talking about the same thing. The association change will win...
...While in_groups and in_groups_of are provided by Rails this also works in pure Ruby. If it does not for you, require 'enumerator...
...x versions of Capybara does not support Ruby 1.8.x anymore removes confusion with Rails' built in integration tests (you put capybara rspec integration tests into the spec/feature/... folder) and...
...some actions protected by SSL, some not. A popular way to implement this in Rails is using the ssl_requirement plugin by DHH, which redirects a requests from HTTP to...
ActiveSupport::Notifications provides an instrumentation API for Ruby. It is used throughout rails to publish instrumentation events that include information about each part of a request/response cycle.
# or without agent: install-gems-remotely me@my.server.com When you call it from a rails directory, it uploads your Gemfile, Gemfile.lock as well as the gemspecs of all vendored gems...
...encode such strings. You probably know Quoted Printable from e-mail bodies appearing in Rails logs, where =s become =3Ds in URLs, or where long lines are split up and...
There are several options, but most of them are impractical. The best way is to use the :ruby filter:
...example to confirm your output in tests), you can use roo. To easily dump Rails records to XLSX, there is also axlsx_rails (haven't tried it yet). xlsx generation...
...you cannot change (e.g. because they are inside a gem, spanning multiple versions of Rails and RSpec), you can explicitly allow the deprecated syntax. Fix Inside spec/spec_helpber.rb, set rspec-expectations...
If possible, make the autoloaded class static by moving it out of Rails' load path...
...it's usually not part of the Gem's API). Unless you're using Rails 4 (which brings String#indent in ActiveSupport), you'll be best of defining it yourself...
I got these warnings while deploying a Rails 3.2 app with asset pipeline enabled: *** [err :: host.tld] find: `/opt/www/hollyapp.com/releases/20120503115342/public/images': No such file or directory *** [err :: host.tld] find: `/opt/www/hollyapp.com/releases/20120503115342/public/stylesheets': No such file...
Observed on Rails 2.3 and machinist 1.0.6 Like the title says, when you define the method empty? like in the following example, you may not longer use collection.make.
...point. A DECIMAL(6,2) column may store numbers up to 9,999.99. In Rails, a decimal column definition looks like this: t.decimal :amount, :precision => 6, :scale => 2. Issue
If you have the following deprecation warning after upgrading to rails >= 2.3.10 DEPRECATION WARNING: The :overwrite_params option is deprecated. Specify all the necessary parameters instead. that is for example...
Consider the following HTML & CSS: ^ img { background-color: red; } div { border: 1px solid black; } This will leave a margin of...
...data in columns. This is helpful for e.g. comparing attributes of a set of Rails records. def tp(objects, *method_names) terminal_width = `tput cols`.to_i cols = objects.count...