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
| # Wouldn't it be great if you could have STI like functionality | |
| # without needing to encode strings of class names in the database? | |
| # Well today is your lucky day! Discriminable Model is here to help. | |
| # | |
| # Simply specify your models desired type column, and provide a block to | |
| # do the discrimination. If you want the whole STI-esque shebang of properly | |
| # typed finder methods you can supply an array of 'discriminate_types' that will | |
| # be used to apply an appropriate type. | |
| # | |
| # class MyModel < ActiveRecord::Base |
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
| cat ~/.config/default/action_cable | |
| RVM_STRING = 2.4.3@schoolhire-app | |
| PUMA_OPTS = "-e staging -p 28080 cable/config.ru" | |
| DAEMON = puma | |
| EXEC_COMMAND = cd /application/current && /.rvm/bin/rvm-shell ${RVM_STRING} -c "bundle exec ${DAEMON} ${PUMA_OPTS}" | |
| ~/.config/systemd/user/action_cable.service | |
| [Unit] | |
| Description = Action Cable |
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
| def recount(hash, sum = 0) | |
| hash.each { |key, value| sum = recount(value, sum + 1) if value.is_a?(Hash) } | |
| sum | |
| end | |
| puts recount2(hash) |
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
| # go to | |
| about:config | |
| # find | |
| network.websocket |