Skip to content

Instantly share code, notes, and snippets.

@TrumpClone
Created March 25, 2017 15:11
Show Gist options
  • Save TrumpClone/4cfa5c50a13b615b64b5db56e4cfcf07 to your computer and use it in GitHub Desktop.
Save TrumpClone/4cfa5c50a13b615b64b5db56e4cfcf07 to your computer and use it in GitHub Desktop.
asd
[1] pry(main)> Distribution::Deliveries::Base.last
=> #<Distribution::Deliveries::Sendgrid @values={:id=>3, :template_id=>1, :title=>"pizda", :from=>"hyi@hui.hyi", :subject=>"poshko", :events=>["user_answered_ticket"], :method_name=>"sendgrid", :segment_type=>"eventless", :segment_name=>"allowed_for_payment_notification", :segment_params=>{}, :created_at=>2017-03-22 16:03:05 +0000, :updated_at=>nil}>
[2] pry(main)> Distribution::Deliveries::Base.last.json
NoMethodError: undefined method `json' for #<Distribution::Deliveries::Sendgrid:0x007fbdd7aec0a8>
from (pry):2:in `__pry__'
[3] pry(main)> Distribution::Deliveries::Base.last.as_json
=> {"id"=>3,
"template_id"=>1,
"title"=>"pizda",
"from"=>"hyi@hui.hyi",
"subject"=>"poshko",
"events"=>["user_answered_ticket"],
"method_name"=>"sendgrid",
"segment_type"=>"eventless",
"segment_name"=>"allowed_for_payment_notification",
"segment_params"=>{},
"created_at"=>"2017-03-22T16:03:05.357+00:00",
"updated_at"=>nil}
[4] pry(main)> Distribution::Templates::Template.last.as_json
=> {"id"=>1,
"state"=>0,
"title"=>"azaza",
"html_content"=>"OTSOSI $email$ SICHARA DI VOT SUDA $url_with_path[/pizda/hui/?jigurda=1]$ xxx $unsubscription_link$ BLIAD!! AHAHA!",
"txt_content"=>"OTSOSI $email$ SICHARA DI VOT SUDA $url_with_path[/pizda/hui/?jigurda=1]$ ",
"attachment_urls"=>[],
"created_at"=>"2017-03-22T15:54:15.849+00:00",
"updated_at"=>"2017-03-23T17:07:54.812+00:00"}
[5] pry(main)> Distribution::Templates::Template.last
=> #<Distribution::Templates::Template @values={:id=>1, :state=>0, :title=>"azaza", :html_content=>"OTSOSI $email$ SICHARA DI VOT SUDA $url_with_path[/pizda/hui/?jigurda=1]$ xxx $unsubscription_link$ BLIAD!! AHAHA!", :txt_content=>"OTSOSI $email$ SICHARA DI VOT SUDA $url_with_path[/pizda/hui/?jigurda=1]$ ", :attachment_urls=>[], :created_at=>2017-03-22 15:54:15 +0000, :updated_at=>2017-03-23 17:07:54 +0000}>
[6] pry(main)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment