RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Submit a post

You can use basic HTML markup (e.g. <a>) or Markdown.
Note that your post may be edited to suit the format of the site.

As you are not logged in, you will be
directed via GitHub to signup or sign in

Post Preview

Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.

Be nice to others and your future-self: use Data Objects.

Data Objects explicitly define available attributes. This self-documentation is a great gift for other developers (and your future-self). In this blog post, I show the benefits of using Data Objects and how to use to Virtus to turn a complex data structure of nested hashes and arrays into Data Objects.

How to raise any object as a Ruby exception

It’s a common misconception that the raise method only accepts exceptions as its argument. This post will show you how you can raise ANYTHING, including numbers, dates, and your own custom classes. - http://blog.honeybadger.io/how-to-raise-any-object-as-a-ruby-exception/

Safely Storing Your Assets: Paperclip With AWS + Heroku

Integrating the paperclip gem is fun until you realize that you have to configure your application to work with AWS and Heroku. Then it might become a little less fun. This blog post walks through the steps of safely storing your assets using AWS S3, Heroku, and how to correctly configure environment variables.

Faster Ruby Testing: Only Test What Matters

Automated testing is important. Fast, exhaustive automated testing is even more important. Tests are responsible for ensuring the code you spend hours creating actually works. A great test suite can be a safeguard against bugs, a directional guide towards extending the code, and an accurate measurement of the codebase’s health. The key to writing good tests is understanding where pieces of responsibility begin and end. Maintaining small concise automated tests can make all the difference.

ActiveRecord isolated, namespaced scopes and methods using instance_exec and ActiveSu

A blog post about creating ActiveRecord concerns that include scopes hidden under chainable namespaces. With this approach you can have multiple scopes with the same name, providing different functionalities, based on a context. It can be also used to namespace everything that is under an ActiveRecord concern module. Read more.

Permittribute

We sometimes face scenarios where we need same permitted attributes for a model in different controllers and end up re-writing all attributes again (violating DRY). Permittribute is meant to: - reuse same permitted attributes at different locations/controllers. - scope permitted attributes base on roles like admin, api etc. - group permitted attributes at a single reference point in their respective scopes. Read more…

Created new package (Eventsims)

Feel free to download my new package called Eventsims . It is a Ruby package for simulating discrete events and workplace scenario. A similar package that I made for Python users is called Eventsim and has an extra feature than the Ruby one. It can be found on the Pypi website

Loading older posts