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
I am attesting that this GitHub handle thenapking is linked to the Tezos account tz2FuyRtdMA8raUUuTXQY4xQjxp2dtkD7qRu for tzprofiles | |
sig:spsig17aZPt4tvaG5P99h38w9Xg6qXZrbykX5na6csiT8GQTTGhWDf3md2DSX4jhBMcJZ6DsZAtWSAPVg95yvHmQVgHMqR55Yxf |
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
I am attesting that this GitHub handle thenapking is linked to the Tezos account tz1LdkNmdi3ij229JjkYeYQ5zCDhSjv8RC3R for tzprofiles | |
sig:edsigtwZjQrB1m3ygvqNdCoQSzvPy9rogdWmRnmJzcMifxwykXfiQXPY17X4Uc9QQkaGGL1JgzL3dBhiW89AWnzi3vpyTkfv7Jk |
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
Tezos Signed Message: I am attesting that this GitHub handle thenapking is linked to the Tezos account tz1LdkNmdi3ij229JjkYeYQ5zCDhSjv8RC3R for tzprofiles | |
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
Tezos Signed Message: I am attesting that this GitHub handle thenapking is linked to the Tezos account tz1LdkNmdi3ij229JjkYeYQ5zCDhSjv8RC3R for tzprofiles |
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
#!/usr/bin/env jruby | |
require 'propane' | |
class Render < Propane::App | |
def settings | |
size 600, 600 | |
end | |
def setup |
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
# models | |
class Location < ActiveRecord::Base | |
has_ancestry cache_depth: true, touch: true, orphan_strategy: :destroy | |
self.inheritance_column = :category | |
def self.categories | |
%w(World Country Division Region Area Store) | |
end | |
belongs_to :parent, class_name: "Location", foreign_key: "parent_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
# Add to gemfile | |
gem 'cocoon' | |
# In application.js | |
//= require cocoon | |
# For a ticket, with associated ticket_comments | |
class Ticket < ActiveRecord::Base | |
has_many :ticket_comments, inverse_of: :ticket_detail |
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
# Examples of relationships | |
belongs_to :location, inverse_of: :people, class_name: "Store", required: true, touch: true | |
has_one :user, inverse_of: :person | |
has_many :user_locations, through: :user | |
has_one :person_flag, inverse_of: :person, autosave: true | |
has_many :pending_change_locations, through: :pending_changes, source: :locations | |
accepts_nested_attributes_for :ticket_comments, allow_destroy: 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
CREATE location_recursion AS | |
WITH recursion_tree AS | |
( | |
SELECT location_id, name, friendly_id, parent_id, manager_id, location_type, parent_location_type, | |
CAST(location_id AS VARCHAR(1000)) AS Path | |
FROM dbo.__Location_Children_vw | |
WHERE (parent_id IS NULL) | |
UNION ALL | |
SELECT t.location_id, t.name, t.friendly_id, t.parent_id, t.manager_id, t.location_type, t.parent_location_type, |
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 Something | |
%w(zero one two three four five six seven eight nine).each_with_index do |w,i| | |
define_method(w) { perform i } | |
end | |
end |
NewerOlder