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
| require 'set' | |
| module Validateable | |
| attr_reader :validation_strategies | |
| def self.included(receiver) | |
| receiver.instance_variable_set(:@validation_strategies, Set.new) | |
| receiver.extend ClassMethods | |
| receiver.send :include, InstanceMethods | |
| end | |
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
| <div class="flash-messages"> | |
| <% %i(error notice success).each do |type| %> | |
| <% if flash[type] %> | |
| <div class="flash-message-<%= type %>"> <%= flash[type] %> </div> | |
| <% end %> | |
| <% end %> | |
| </div> |
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
| for user in users | |
| try | |
| create_user(user) | |
| catch Sequel::Error => e | |
| #log error | |
| next | |
| end | |
| end | |
| ## |
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
| class ReportFormatter | |
| class << self | |
| def ascii(data) | |
| new.ascii(data) | |
| end | |
| end | |
| # {first_table: [{title: "contents"}], second_table: []} | |
| def ascii(data) | |
| data.map do |k, v| |
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
| define('timezones', [], function(){ | |
| return [ | |
| { | |
| "value": "Dateline Standard Time", | |
| "abbr": "DST", | |
| "offset": -12, | |
| "isdst": false, | |
| "text": "(UTC-12:00) International Date Line West" | |
| }, | |
| { |
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
| var pickFiles = require('broccoli-static-compiler'); | |
| var foundation = pickFiles('bower_components/foundation/scss/foundation', { | |
| srcDir: '/', | |
| files: ['**/*'], | |
| destDir: '/assets/foundation' | |
| }); | |
| var mergeTrees = require('broccoli-merge-trees'); | |
| module.exports = mergeTrees([app.toTree(), foundation], { | |
| overwrite: true |
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
| import Ember from 'ember'; | |
| export default Ember.Route.extend({ | |
| actions: { | |
| saveModel: function() { | |
| Ember.RSVP.all([ | |
| this.currentModel.save(), | |
| this.currentModel.get('notifications').save() | |
| ]).then( () => { | |
| this.showFlashNow('Saved Successfully!', 'success'); |