Skip to content

Instantly share code, notes, and snippets.

function editService($id = null){
if($this->request->is(array('post','put'))){
$currentUser = $this->Auth->user();
if($this->request->data['Service']['user_id'] != $currentUser['SppUser']['id']){
$this->Session->setFlash(__('Bạn không có quyền chỉnh sửa thông tin của dịch vụ này.'));
return $this->redirect($this->referer());
}else{
if($this->Service->save($this->request->data)){
$this->Session->setFlash(__('Đã cập nhật thành công.'));
return $this->redirect(array('action' => 'index'));
hook_data = {
"anonymousId"=>nil,
"channel"=>"server",
"context"=>{"library"=>{"name"=>"simple_segment", "version"=>"0.1.1"}},
"event"=>"signup",
"integrations"=>{},
"messageId"=>"api-bV5ZmieDrhHeMrqwsAqqUytqWec3q6EY",
"originalTimestamp"=>"2016-11-10T00:32:29+08:00",
"projectId"=>"3jjqD3uFsq",
"properties"=>nil,
@vutran0111
vutran0111 / gist:1864afec89fc862d61f2f729b3121b31
Created August 4, 2017 03:40
bundle exec rspec spec/models/segment_hook_handler_spec.rb
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
Randomized with seed 14787
SegmentHookHandler
page hooks
sends the event to keen as a segment_page_view (FAILED - 1)
identify hooks
@vutran0111
vutran0111 / rdrc2016.md
Created June 26, 2016 15:46 — forked from cheeaun/rdrc2016.md
RedDotRubyConf 2016 links & resources 😘