Data dodania Pytanie
2017-10-12 23:10 Sinatra {"Content-Type"=>nil} - form response »
I've tried thoroughly researching the answer to this but I haven't been able to find what I'm looking for. I'm a baby coder (still learning) and am bu...
(0) odpowiedzi
2017-10-12 22:10 Slow loading Rails 5.1.4 with Ruby 2.3.3-p222 »
I have standard view with 1 database query (MySQL). I am using Devise and method for checking is it user logged in layouts/application.html.erb: <...
(1) odpowiedzi
2017-10-12 21:10 Test order(sequence) of content using capybara »
I have tried using below syntax: page.body.index('Name') < page.body.index('Phone') But problem is that if there are multiple strings with same ...
(0) odpowiedzi
2017-10-12 20:10 Pg_search trouble with dot »
I am using pg_search to find links, but this does not work well because of. in the link. I have a model link and another company, each link belongs t...
(0) odpowiedzi
2017-10-12 18:10 ruby json get values from array »
I have a this json that has a arrays in it. How can i get : - full_text, - picture link : media_url_https from media and from extended_entities - url ...
(1) odpowiedzi
2017-10-12 17:10 Sidekiq - Any side effect of a worker pushing to another queue? »
I'm processing many Sidekiq jobs (tens of millions) which return 1 string and 2 integers as a result. There is a central computer which is hosting the...
(1) odpowiedzi
2017-10-12 16:10 ruby's Net::HTTPResponse attribute 'code' returns string »
Why is the Net::HTTPResponse attribute 'code' returning a string? Coming from other languages this doesn't make sense to me. ...
(1) odpowiedzi
2017-10-12 14:10 Rails add 'rescue_from' method to application controller from patch//plugin »
I am trying to patch the ApplicationController of my Rails(4.2.5) application from a plugin. I want to add 'rescue_from ActiveRecord::RecordNotFound'...
(1) odpowiedzi
2017-10-12 11:10 How to edit user controller in devise so I can update my user's profile without devise »
I have an app that uses devise for sign up and login. I'm trying to create the edit account page. I was wondering if I can update the user informatio...
(1) odpowiedzi
2017-10-12 10:10 java.lang.NoSuchMethodError: org.apache.pdfbox.pdmodel.PDDocument.getPages() »
when I use Jruby and pdfbox,I meet a problem. The jar includes this method. Caused by: java.lang.NoSuchMethodError: org.apache.pdfbox.pdmodel.PDDocu...
(0) odpowiedzi
2017-10-11 23:10 Ruby: How to include outside module in Rspec test »
I have 2 projects, a "common code" project that i have made into a big module that pulls in other modules like so: Here is the folder structure of "m...
(1) odpowiedzi
2017-10-11 21:10 Get hash of id => property in Rails »
I have an ActiveRecord model like this: class Person < ActiveRecord::Base attr_accessible :name end and need to get a hash mapping Person's id...
(3) odpowiedzi
2017-10-11 19:10 Simple Form - Custom Input Not Being Recognized »
So I'm wanting to have a custom input component defined for a simple form and have the following: # app/inputs/gds_input.rb class GdsInput < Simpl...
(1) odpowiedzi
2017-10-11 18:10 folding and currying with Ruby »
I'm exploring Functional Programming with the Ruby language. Below is my version of a Fold in Ruby. I've tested it on a variety of functions, reverse,...
(2) odpowiedzi
2017-10-11 17:10 Using .constantize to invoke both a class and method from separate strings »
I'm trying to call a class and method which are both stored as strings in the DB. I would be looking to create an object from these 2 strings class_...
(4) odpowiedzi
2017-10-11 16:10 Scope on Polymorpic model in Ruby on Rails »
Is it possible to make a scope for a polymorphic model in the following case? I have a polymorphic model named Mutations. class Mutation < Applic...
(2) odpowiedzi
2017-10-11 15:10 RSpec - testing race conditions »
I'm trying to write a RSpec controller test checking for race conditions based on this blog post, but created Threads don't "see" the Users created at...
(0) odpowiedzi
2017-10-11 15:10 Custom validator on associated model make other Rspec model tests break »
I have 2 models sharing a simple belong_to/has_many relation: Room belongs to Building I created a custom validator called total_number_rooms_limited...
(1) odpowiedzi
2017-10-11 13:10 Updating to Rails 5 schema issue »
Recently I have been attempting to update an existing Ruby on Rails application from Rails version 4.2.7.1 to version 5.0.6. After spending a fair amo...
(0) odpowiedzi
2017-10-11 11:10 Rails: show name instead of Id in a show page »
I have two tables, accounts and items and I would like to show the buisness_name instead of the idfrom the accounts table on the view/items/show.html....
(2) odpowiedzi
2017-10-11 04:10 Ranked Model Sortable row_order is reversed after saved with Rails 3 »
I'm currently working on a Project which requires me to implement the feature of Drag and Drop for items. My project is using Rails 3.2.13 and using r...
(0) odpowiedzi
2017-10-10 17:10 How to change Ruby version for Homebrew in macOS in Travis CI? »
Trying to run if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python3; fi in before_install, I end up with /usr/local/Homebrew/Library/Home...
(2) odpowiedzi
2017-10-10 17:10 Undefined URL Helper Method for Anonymous Class »
I ran a scaffold command for rails and have been unable to get the specs working for the views. They always fail when a URL helper method is called sa...
(0) odpowiedzi
2017-10-10 13:10 jQuery ajax works but not native JS ajax »
I have the following code: Controller def some_method respond_to do |format| format.js { render js: "alert();" } end end JS This executes al...
(1) odpowiedzi
2017-10-10 11:10 Conditional assignment with empty strings »
I love conditional assignment syntax in Ruby and use it all the time: x = this_var || that_var Right now I am working with several APIs, which retu...
(2) odpowiedzi
2017-10-10 11:10 Difference in days between 2 dates in Ruby or RoR »
I have 2 dates, without time. I want to a number of days between them. Integer positive number. Or just Integer. I can't find it -- the type system ...
(2) odpowiedzi
2017-10-10 08:10 Rails Rspec test fails when it works in app »
I have the following code and test that I can't seem to make pass. The code should be auto locking all bookings that have been completed over 24 hours...
(3) odpowiedzi
2017-10-09 21:10 import records using the gem roo »
I am trying to import records to the database using the gem roo using excel files, it works pretty well making use of this tutorial, I am importing ne...
(0) odpowiedzi
2017-10-09 19:10 RSpec testing of a multiprocess library »
I'm trying to test a gem I'm creating with RSpec. The gem's purpose is to create queues (using 'bunny'). It will serve to communicate between process...
(1) odpowiedzi
2017-10-09 18:10 Rails : Couldn't find Item with 'id'= »
I'm trying to implement add to favorites and I'm getting this error: ActiveRecord::RecordNotFound in FavoriteItemsController#index Couldn't find I...
(2) odpowiedzi
2017-10-09 16:10 How to convert from FILETIME to Ruby time and vice-versa »
MSDN defines FILETIME as 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC). How to convert between...
(2) odpowiedzi
2017-10-09 14:10 Testing a method that delegates to another object »
This is a model in my project - class Subscription < ActiveRecord::Base def active? SubscriptionValidationPolicy.new(self).active? end en...
(1) odpowiedzi
2017-10-09 13:10 Rails ActiveRecord inserting/updating range type (Postgresql) »
I have a height_ranges table on my database, which stores numeric ranges. migration file class CreateHeightRanges < ActiveRecord::Migration de...
(1) odpowiedzi
2017-10-09 08:10 Ruby custom sorting of first n elements »
I would like to sort an array of string based on my custom ordering. Problem is I dont know all the elements in array but Im sure that it has 3 string...
(1) odpowiedzi
2017-10-09 00:10 Why is one of these functions changing the original array and not the other? »
I'm not sure what I am missing by looking at these three functions. The desired result for these functions would be that the original array changes va...
(1) odpowiedzi