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 "test_helper" | |
| class TierMembershipTest < ActiveSupport::TestCase | |
| context "associations" do | |
| should belong_to :user | |
| should belong_to :tier | |
| 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 TierMembership < ActiveRecord::Base | |
| attr_accessible :tier, :user | |
| belongs_to :tier | |
| belongs_to :user | |
| validates :user_id, presence: true | |
| validates :tier_id, presence: true, uniqueness: { scope: :user_id } | |
| validate :valid_user_role |
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 Backend::Settings::TiersController < BackendController | |
| before_filter :authorize_admin | |
| def index | |
| @tiers = current_company.tiers.order('sort ASC') | |
| end | |
| def update | |
| @tier = current_company.tiers.find(params[:id]) |
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 'test_helper' | |
| class TierTest < ActiveSupport::TestCase | |
| context "validations" do | |
| should validate_uniqueness_of(:name).scoped_to(:company_id) | |
| end | |
| context "associations" do | |
| should belong_to :company |
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
| // Legacy cm.e support | |
| if (cm.e) { | |
| snippetNeedsUpdating = true; | |
| // Process queued errors | |
| for (var i=0; i < cm.e.length; i+=1) { | |
| cm.onerror.apply(this, cm.e[i]); | |
| } | |
| // Override push to immediately call onerror | |
| cm.e.push = function(message, file, line, column) { | |
| cm.onerror(message, file, line, column); |
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
| { "order": { | |
| "id": 1, | |
| "client_id": "815", | |
| "articles": [ | |
| {"title": "Lonestar Beer", | |
| "id": 666, | |
| "links":[ | |
| { "rel": "self", | |
| "href": "http://articles/lonestarbeer"} | |
| ]} |
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
| " Highlight currently open file in nerdtree | |
| " see http://superuser.com/a/474298/175466 | |
| " see http://superuser.com/a/509721/175466 | |
| " returns true iff is NERDTree open/active | |
| function! rc:isNTOpen() | |
| return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1) | |
| endfunction | |
| " returns true iff focused window is NERDTree window |
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
| .cols | |
| position: absolute | |
| top: $header-height | |
| bottom: 0 | |
| left: $navigation-width | |
| right: 0 | |
| .col | |
| position: absolute | |
| top: 0 | |
| bottom: 0 |
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
| package main | |
| import ("fmt") | |
| func main() { | |
| π(); | |
| } | |
| func π() { | |
| fmt.Printf("christmas!"); |
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
| package main | |
| import ("fmt") | |
| func main() { | |
| סּںסּَ(); | |
| ☃(); | |
| } | |
| func סּںסּَ() { |