Skip to content

Instantly share code, notes, and snippets.

Avatar

francisco Quinones Frank004

  • HB Quality Ware
  • Puerto Rico
View GitHub Profile
View error terminal
11:03:14 system | SIGINT received, starting shutdown
11:03:14 worker.1 | 2017-11-20T15:03:14.544Z 4890 TID-owsvrlfh0 INFO: Shutting down
11:03:14 worker.1 | 2017-11-20T15:03:14.545Z 4890 TID-owsvrlfh0 INFO: Terminating quiet workers
11:03:14 worker.1 | 2017-11-20T15:03:14.546Z 4890 TID-owsvvwzpc INFO: Scheduler exiting...
11:03:14 redis_s.1 | 4892:M 20 Nov 11:03:14.637 # User requested shutdown...
11:03:14 redis_s.1 | 4892:M 20 Nov 11:03:14.637 * Saving the final RDB snapshot before exiting.
11:03:14 redis_s.1 | 4892:M 20 Nov 11:03:14.639 * DB saved on disk
11:03:14 redis_s.1 | 4892:M 20 Nov 11:03:14.639 # Redis is now ready to exit, bye bye...
11:03:14 worker.1 | 2017-11-20T15:03:14.651Z 4890 TID-owsvvwz5w ERROR: Error fetching job: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)
11:03:14 worker.1 | 2017-11-20T15:03:14.651Z 4890 TID-owsvvwz5w ERROR: /Users/IFrank/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/redis-3.3.5/lib/redis/client.rb:345:in `rescue in establish_connection'
View column_pass_value.txt
This is the value that Im storing in the json
permits: {
"foo_permit"=>{
"can"=>["index", "show", "update", "destroy", "create", "schedule"],
"show"=>"true", "index"=>"true", "create"=>"true", "update"=>"true", "destroy"=>"true", "schedule"=>"true", "controller"=>"Foo"},
...
}
View check_score_value.rb
def check_has_score
if foos.where(overall_score: 0.0).any?
errors.add(:base, "No puede cerrar la Bar hasta que todas los foo tengan puntuación")
end
end
View aws.rb
Aws.config.update({
region: ENV['AWS_REGION'],
credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']),
})
S3_BUCKET = Aws::S3::Resource.new.bucket(ENV['S3_BUCKET_NAME'])
View code_ints_and_class.rb
def instance_method
**codigo**
self.class.foo(arg1,agr2)
self.class.bar(arg)
end
def self.method_class
**codigo**
foo(arg1,agr2)
bar(arg)
View date.rb
where("end_date < ?", Hoy)
View _ba_partial.html.erb
#--------ba_partial-------
<%= bootstrap_form_for ba, remote: true, data_id: ba.id do |f| %>
...
<div id="loader" class='load-ajax hide'></div>
<% end %>
View application.js
//= require jquery_ujs
//= require jquery.remotipart
View error.rb
2016-12-19T15:33:56.927Z 7489 TID-ox4ubmy98 INFO: Booting Sidekiq 4.2.7 with redis options {:size=>27, :url=>"redis://localhost:6379/0"}
11:33:56 worker.1 | "[Sidekiq] Running locally, so autoscaler isn't used"
11:33:58 worker.1 | 2016-12-19T15:33:58.356Z 7489 TID-ox4ubmy98 INFO: Running in ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
11:33:58 worker.1 | 2016-12-19T15:33:58.356Z 7489 TID-ox4ubmy98 INFO: See LICENSE and the LGPL-3.0 for licensing details.
11:33:58 worker.1 | 2016-12-19T15:33:58.356Z 7489 TID-ox4ubmy98 INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org
11:33:58 worker.1 | 2016-12-19T15:33:58.361Z 7489 TID-ox4ubmy98 INFO: Starting processing, hit Ctrl-C to stop
11:34:10 worker.1 | 2016-12-19T15:34:10.773Z 7489 TID-ox4vqdyhs MyWorker JID-882bc1314ea2ee37435e89ce INFO: start
11:34:10 worker.1 | 2016-12-19T15:34:10.775Z 7489 TID-ox4vqe0x0 MyWorker JID-8d1f27f683ff53d80921744f INFO: start
11:34:10 worker.1 | 2016-12-19T15:34:10.798Z 7489 TID-ox4vq
View gist:04177f9121dd14d5824008b9a447a6a8
User
belongs_to :company
Company
has_many :employees, class_name: "User"
has_many :clients, class_name: "User"
# ----
companyA.clients.count
3
companyA.employees.count
You can’t perform that action at this time.