makandra dev

...More than twice the amount of courses is probably not sensible, booting up rails takes its time, too...

solnic.eu

...simple definition of meta-programming macros like the has_many that you know from Rails. Modularity also lets you organize large models into multiple source files in a way that...

...to Cucumber that helps integration-testing command line tools. When your tests involve a Rails test application, your tool's Bundler environment will shadow that of the test application. To...

makandra dev
github.com

...be docked to I18n (configured explicitly on plain Ruby, or use .yml files for Rails): "one & two".convert_miscellaneous_characters # => "one and two" "my words".convert_miscellaneous_html_entities...

...column" ASC NULLS FIRST Your indexes will have to specify this as well. In Rails, declare them using add_index :table, :column, order: { column: 'DESC NULLS LAST' } Multiple columns

...param is a string and you don't get the magic type casting that Rails would give you if it was an actual database column. One effect is that when...

Note: This applies to plain Ruby scripts, Rails does not have this issue. When you work with Ruby strings, those strings will get some default encoding, depending on how they...

...need to represent later time values, use the DateTime class. This is also what Rails does when it loads a record from the database that has a DATETIME value which...

developer.mozilla.org

...class: 'image-preview' The image_tag will either contain an existing image (rendered by Rails) or be overwritten by Unpoly with an image preview. Testing Here's a Cucumber step...

The bin/webpack-dev-server command is not as smart as e.g. rails server, where it shows the proper fix within the error message. $ bin/webpack-dev-server yarn run v1.19.1 error Command "webpack-dev-server...

...using Middleman for some static sites like our blog. Despite being very similar to Rails, Middleman does not add a fingerprint hash to its asset paths by default. This means...

stackoverflow.com

...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):

makandra dev
dev.mensfeld.pl

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...

makandra dev

...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...

makandra dev
github.com

...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...

api.rubyonrails.org

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...