Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| plop |
| con.with_connection do | connection | | |
| connection = connection.raw_connection | |
| query_result = connection.exec_params( | |
| "DELETE FROM feed_relation_links | |
| WHERE group_id = $1 AND element_type = $2 AND element_id = $3", | |
| [ _id, _element_type, _element_id] | |
| ) | |
| end |
| class RepositoryUser | |
| def new_user( _user_attrs ) | |
| User.new( _user_attrs ) | |
| end | |
| def find_by( _attr, _value ) | |
| return User.where( [ "? = ?", _attr, _value ] ).first() | |
| end |
| # test/controllers/users_controller_test.rb | |
| class UsersControllerTest < ActionController::TestCase | |
| setup do | |
| @user_admin = User.find_by_email('[email protected]') #=> Not Find.. | |
| @user = User.new(email: '[email protected]', name: 'Jean', token: 'plop', public_key: 'plip') | |
| # test helper method | |
| login_as(@user_admin) | |
| end | |
| end |
| class Project < ActiveRecord::Base | |
| track_who_does_it | |
| belongs_to :organization | |
| has_many :teams, :dependent => :destroy | |
| has_many :trackers, :dependent => :destroy | |
| has_many :layouts, :dependent => :destroy | |
| accepts_nested_attributes_for :trackers, :reject_if => lambda { |a| a[:name].blank? }, :allow_destroy => true |
| { | |
| "jobs": [ | |
| { | |
| "provider": { | |
| "id": "603200674294177794", | |
| "provider": "twitter", | |
| "uploaded_at": "2015-05-26 14:07:02" | |
| }, | |
| "author": { | |
| "id": "3031159317", |
| module Administration | |
| class Administration::BaseController < ApplicationController | |
| layout 'administration' | |
| private | |
| def current_session_process_id(_city_id, _process_id = nil ) | |
| session["user.process_id.#{ _city_id }"] = _process_id if _process_id | |
| session["user.process_id.#{ _city_id }"] |
| { | |
| "match_details": { | |
| "players": [ | |
| { | |
| "account_id": 98887913, | |
| "player_slot": 0, | |
| "hero_id": { | |
| "id": 69, | |
| "name": "Perseverance" | |
| }, |
Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)