vagrant@precise64:/opt/substrakt/directorsuk$ bundle install
...
Using bundler 1.10.6
Using sprockets 3.5.1
Using sprockets-rails 2.3.3
Using rails 4.2.4
Using rails-assets-clipboard 1.5.5
Using rails-assets-jquery 2.1.4
Using rails-assets-cropper 2.2.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
source 'https://rails-assets.org' do | |
gem 'rails-assets-pickadate' | |
gem 'rails-assets-select2' | |
gem 'rails-assets-underscore' | |
gem 'rails-assets-clipboard' | |
gem 'rails-assets-trix' | |
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 HierarchyProcessor | |
attr_reader :input, :user | |
def initialize(input, user) | |
raise ArgumentError, "user expected User, was #{ user.class }" unless user.is_a?(User) | |
@input = JSON.parse(input) | |
@user = user | |
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 HierarchyProcessor | |
attr_reader :input, :user | |
def initialize(input, user) | |
raise ArgumentError, "user expected User, was #{ user.class }" unless user.is_a?(User) | |
@input = JSON.parse(input) | |
@user = user | |
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
def service_groups | |
ServiceGroup.where(id: @input['service_groups'].map{ |s| s['id'] }) | |
end | |
def locations | |
------------------- ---------------------- | |
Location.where(id: @input['locations'].map{ |s| s['id'] }) | |
------------------- ---------------------- | |
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
def output_100 | |
puts 100 | |
end | |
# is exactly the same as -> | |
define_method(:output_100) do | |
puts 100 | |
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
[:output_100, :output_200].each do |i| | |
define_method(i) do | |
puts i.to_s.split('_')[1] | |
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 HierarchyProcessor | |
attr_reader :input, :user | |
def initialize(input, user) | |
raise ArgumentError, "user expected User, was #{ user.class }" unless user.is_a?(User) | |
@input = JSON.parse(input) | |
@user = user | |
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
server { | |
listen 80; | |
listen [::]:80; | |
listen 443 default ssl; | |
server_name YOURDOMAIN.com; | |
if ($ssl_protocol = "") { | |
rewrite ^ https://$server_name$request_uri? permanent; | |
} |
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
include HTTParty | |
query = {} | |
query["x"] = ['value1', 'value2'] | |
response = HTTParty::Basement.get(__URL__, query: query, | |
query_string_normalizer: HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER) |