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 Travel < AdditionalInformation; end | |
| [:test, :bob].each_with_object({}) do |key, res| | |
| res[key] = params[key] if params[key] | |
| 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
| saveNewPhoto: -> | |
| newImage = @store.createRecord 'event_image', { | |
| image: @get 'newPhotoImage' | |
| caption: @get 'newPhotoCaption' | |
| event: @get 'model' | |
| } | |
| newImage.save().then ((img)=> | |
| @get('event_images').pushObject img | |
| Ea.get('flash').success 'Image added' | |
| ), (=> |
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
| "Jake Craige & Matthew Hager | |
| " Setup {{{ | |
| set rtp+=~/.poetic_dotfiles/powerline/powerline/bindings/vim/ | |
| if filereadable(expand("~/.vimrc.bundles")) | |
| source ~/.vimrc.bundles | |
| endif | |
| filetype plugin indent on | |
| " }}} |
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 top_retailers | |
| retailers = self.site_product_prices.last_24_hours.trusted.by_price | |
| retailers = retailers.group_by { |retailer| retailer.site } | |
| .map(&:last) | |
| .each{ |sites_array| sites_array.sort_by! { |site| site.weight }.reverse! } | |
| .map(&:first).reverse | |
| .sort_by { |x| x.price } | |
| if retailers.count > 1 |
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 information_type | |
| params[:type].constantize | |
| 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
| resources :others, controller: :additional_informations, type: "Other" | |
| resources :promos, controller: :additional_informations, type: "Promo" | |
| resources :gifts, controller: :additional_informations, type: "Gift" | |
| resources :travels, controller: :additional_informations, type: "Travel" | |
| resources :lodgings, controller: :additional_informations, type: "Lodging" |
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 ChangeAdditionalInformationColumnsToPromos < ActiveRecord::Migration | |
| class RealPromo < ActiveRecord::Base; self.table_name = 'promos'; end | |
| def up | |
| rename_column :additional_informations, :body, :description | |
| add_column :additional_informations, :title, :string | |
| add_column :additional_informations, :url, :string | |
| add_column :additional_informations, :phone, :string | |
| add_column :additional_informations, :type, :string, default: 'Other' |
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 ng-show="!_.isEmpty(notInvitedGuests)" ng-repeat="(groupName, guests) in notInvitedGuests"> | |
| <h3 class="topcoat-list__header caps"> | |
| <label class="topcoat-checkbox"> | |
| <input type="checkbox" selectallgroup> | |
| <div class="topcoat-checkbox__checkmark"></div> | |
| </label> | |
| {{ groupName }} - Not Yet Invited | |
| </h3> | |
| <ul class="topcoat-list__container"> | |
| <li class="topcoat-list__item small disclosure" ng-show="guests" ng-repeat="guest in guests"> |
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
| $scope.$watch 'invites', ()-> | |
| selected = _.map $scope.invites, (ele, index)-> | |
| parseInt(index) if ele is true | |
| $scope.invitesPrepared = _.compact selected # remove undefined's | |
| $scope.inviteLength = $scope.invitesPrepared.length | |
| , 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
| module.directive 'selectallgroup', -> | |
| restrict: 'A' | |
| link: (scope, ele, attrs)-> | |
| $(ele).on 'change', -> | |
| $(@).parents('h3').next('ul').find('input[type=checkbox]').each ()-> | |
| unless $(@).is(':disabled') | |
| selectAllChecked = $(ele).prop('checked') | |
| if selectAllChecked | |
| $(@).prop('checked', false) |