This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ArelHelpers | |
| extend self | |
| def self.included(base) | |
| base.extend self | |
| end | |
| def asterisk(arel_table_or_model) | |
| arel_table, columns = case arel_table_or_model | |
| when Arel::Table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Allows you to build a Hash in a fashion very similar to Builder. Example: | |
| # Fork of https://gist.github.com/360506 by BrentD with some enhancements | |
| # | |
| # HashBuilder.build! do |h| | |
| # h.name "Nilesh" | |
| # h.skill "Ruby" | |
| # h.skill "Rails" # multiple calls of the same method will collect the values in an array | |
| # h.location "Udaipur, India" do # If a block is given, first argument will be set as value for :name | |
| # h.location do | |
| # h.longitude 24.57 |