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
| { | |
| "platform": [ | |
| { | |
| "title": "Visited TA Site", | |
| "value": 2000 | |
| }, | |
| { | |
| "title": "Visited Minutes App", | |
| "value": 2000 |
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
| description "Find a Player API" | |
| setuid deploy | |
| setgid deploy | |
| start on runlevel [2345] | |
| stop on runlevel [016] | |
| expect stop | |
| respawn |
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
| defp ensure_sso_defaults(changeset) do | |
| # One of these fields needs to exist | |
| # for us to overwrite the email & password | |
| is_sso = ( | |
| get_field(changeset, :digits_id) || | |
| get_field(changeset, :facebook_id) || | |
| get_field(changeset, :sms_verification_id) | |
| ) | |
| changeset = |
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
| defmodule Mix.Tasks.MigrateContactDetails do | |
| use Mix.Task | |
| import Ecto.Query, only: [from: 2] | |
| @shortdoc "Migrate ContactDetails data into NewContactDetails" | |
| def run(), do: run(0) | |
| def run(_args) do | |
| Mix.Task.run "app.start", [] |
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
| if player.state == Player.states[:requested_to_join] | |
| message = "#{current_user.name} has requested to join '#{player.play.event.name}'" | |
| uri_opts = {notif_event: "request_to_join", from_id: player.id} | |
| category = "request_to_join" |
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
| # -> UriBuilder.build([["user", 1]], {view: "stats"}) | |
| # => "fap://user/1?view=stats" |
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
| # -> UriBuilder.build([["user", 1]]) | |
| # => "fap://user/1" | |
| # -> UriBuilder.build([["event", 1], ["play", 5], ["player_mgmt"]]) | |
| # => "fap://event/1/play/5/player_mgmt" |
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
| schema "venues" do | |
| field :name, :string | |
| field :description, :string | |
| field :address, :string | |
| field :cover_photo, :string | |
| field :postcode, :string | |
| field :is_private, :boolean | |
| belongs_to :owner, DB.Session | |
| 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
| module DistanceScopable | |
| extend ActiveSupport::Concern | |
| included do | |
| # Select a specified distance from the coordinate of the table (in meters) | |
| scope :distance_to_point, lambda { |table_name: self.table_name, srid: 4326, lat: nil, lng: nil, distance: 5000| | |
| fail 'Attributes missing' if distance.nil? || lat.nil? || lng.nil? || srid.nil? | |
| select(<<-SQL.squish | |
| ST_Distance( | |
| #{table_name}.coordinates, |
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 find_events_by_coordinate(event) | |
| return event if @coordinates.nil? | |
| return event if @coordinates['latitude'].nil? || @coordinates['longitude'].nil? | |
| if @coordinates['latitude'].is_a? String | |
| @coordinates['latitude'] = @coordinates['latitude'].to_f | |
| end | |
| if @coordinates['longitude'].is_a? String | |
| @coordinates['longitude'] = @coordinates['longitude'].to_f |