Data dodania Pytanie
2017-07-15 22:07 RSpec Controller Destroy Testing »
I'm building a test application that lets user create/delete posts. I'm having a bug in my destroy action that I'm finding difficult to debug. Here's ...
(1) odpowiedzi
2017-07-15 20:07 iterate over a multidimensional array and print all possibility »
i try to iterate over a multidimensional array to print all possible choice. I dont understand why i cant print the second params2 from the first arra...
(1) odpowiedzi
2017-07-15 19:07 Same routes in multiple resources »
I am working on a new rails application and came to this scenario. I want same routes in multiple resources but I don't want to repeat the same lines....
(1) odpowiedzi
2017-07-15 06:07 NoMethodError in controller »
Hello I'm new at Ruby and I'm trying to make a method in my Project controller like so: def update_phase @project = Project.find(params[:id]) ...
(1) odpowiedzi
2017-07-15 06:07 Rails find_each method returning nill on console? »
User.find_each do |user| user.name end Output: User Load (0.9ms) SELECT `users`.* FROM `users` ORDER BY `users`.`id` ASC LIMIT 10000 => nil...
(2) odpowiedzi
2017-07-15 06:07 How to achieve concept of connection list with minimal cost using rails ActiveRecord? »
Say User A is connected to B, then user B is automatically considered to be connected with user A. User has_many connection Connection Table: id, ...
(1) odpowiedzi
2017-07-14 23:07 OmniAuth Facebook dos not return E-Mail in Rails 5 »
This question is already on SO but since the API and Gem version changed I wanted to ask again and hope to find an answer this way. I am using Rails ...
(0) odpowiedzi
2017-07-14 20:07 Ruby on Rails resque task gets error »
I'm trying to use resque in my ruby on rails application. I created resque.rake file in lib/tasks folder require 'resque/tasks' task 'resque:setup'...
(1) odpowiedzi
2017-07-14 19:07 self.included – including class methods from a module in Ruby »
I read this post: Ruby modules - included do end block – but still don't get when you would use the self.included do ... end block in a module. ...
(2) odpowiedzi
2017-07-14 18:07 Load file error on Rspec »
I'm following along with a tutorial on testing with Rspec. Getting a syntax error when trying to run the test. Here's my test code: require 'rails_he...
(2) odpowiedzi
2017-07-14 17:07 Possible missing value with parameters in Rails app »
I'm new to Rails and I have no idea what's going on here. The app I am building is an online store. The current functionality works, but the change I ...
(1) odpowiedzi
2017-07-14 13:07 Share a Net::IMAP connection between controller actions »
I have only one controller and some actions in it to handle different functionalities related to IMAP. So my problem is I don't want to create a separ...
(2) odpowiedzi
2017-07-14 13:07 before_destroy check if attribute for related model is given (version control) »
i have a model which has_many relation to a version model. Any action on the parent model need to be tracked. At the form for delete i have added a ne...
(1) odpowiedzi
2017-07-14 09:07 Using metaprogramming to write a single spec for multiple workers »
I have written a sidekiq worker spec. So right now we have four worker with almost the same spec. All spec will be testing for some_method and checkin...
(1) odpowiedzi
2017-07-14 05:07 Undefined method in controller (Routing) »
I'm new at rails and I'm currently working on an already existing application that handles butons like so: <%= link_to 'Edit', edit_answer_path(an...
(2) odpowiedzi
2017-07-13 22:07 How can an inherited controller add to parent's before_action conditions »
class ParentController < ApplicationController before_action admin_user, only: [:create, :update] end class ChildController < ParentControlle...
(2) odpowiedzi
2017-07-13 20:07 Hash subtraction in ruby »
I have 2 hashes (that later will be converted to array, not sure if this is relevant): Hash1 = {"X"=>2, "Y"=>1, "Z"=>1} Hash2 = {"X"=>1,...
(3) odpowiedzi
2017-07-13 19:07 required input in activeadmin form not working »
I am using active_admin. I am trying to make a form field required in activeadmin: input :team, as: :select, required: true, collection: Team.all....
(1) odpowiedzi
2017-07-13 17:07 RSpec not recognizing deleted association »
In my rails application, a user has many baskets, and a basket belongs to a user. The User class also contains an instance method that removes the use...
(1) odpowiedzi
2017-07-13 10:07 How to write a RSpec using httprb/http gem with timeout »
According to httprb/http gem's wiki, there is a way to enable per operation timeouts to handle Timeout like: HTTP.timeout(:per_operation, :write =&gt...
(1) odpowiedzi
2017-07-13 09:07 Put class instance to class constant in initializers »
In one of my old apps, I'm using several API connectors - like AWS or Mandill as example. For some reason (may be I saw it somewhere, don't remember)...
(2) odpowiedzi
2017-07-13 01:07 Casting JSON with ActiveRecord raw query »
Is it possible to make ActiveRecord to cast JSON values from the raw queries somehow? Here's an example where I want to get {"x": 1} result to be cas...
(1) odpowiedzi
2017-07-13 00:07 Why does Ruby fail to remove method even though it is clearly defined? »
I work on a rather complex Ruby project that has multiple interdependencies. With recent bundle update, I got logging-rails (0.6.0) pulled in, and tha...
(0) odpowiedzi
2017-07-12 19:07 Get unique array of month and years between two dates »
I have two Date objects, for example: first = Fri, 02 Dec 2016 last = Wed, 01 Mar 2017 What is the most efficient way to get a unique array of mon...
(6) odpowiedzi
2017-07-12 17:07 How to model a doctor and patient appointments in rails? »
Rails and stackoverflow beginner here so please pardon me for any mistakes. I am developing an appointment booking system between doctors and patient...
(0) odpowiedzi
2017-07-12 15:07 config/environments/development.rb command not found »
I would like run a gitlab ruby on rails project. After cloning I would like to build up the environment but there is permission problems. config/envi...
(2) odpowiedzi
2017-07-12 13:07 Can someone explain to me what this code is doing? »
I am currently building an online course and I was having trouble accessing a lesson that is associated with a certain course. A developer friend of ...
(3) odpowiedzi
2017-07-12 12:07 Rest client post request, error with multipart »
I have the following ajax request which works fine, but when i try the same through rest-client ruby gem i'm getting the following error "{\"error\":...
(0) odpowiedzi
2017-07-12 12:07 Rails/MySQL ActiveRecord::RecordNotUnique »
I have this confusing error message ActiveRecord::RecordNotUnique This is my model: artisan.rb : class Artisan < ActiveRecord::Base require 'cs...
(1) odpowiedzi
2017-07-12 05:07 Can Nightwatch be used to test Rails? »
A contractor for our startup installed the Selenium-based Nightwatch testing framework, since our stack is React-heavy. But he told me that it could e...
(1) odpowiedzi
2017-07-12 05:07 rails factory rspec tests failing because of "only_integer" validation in model »
I have a factory for my model 'price' but all rspec tests start failing when I put the validation for price as only_integer. The error i get when i tr...
(1) odpowiedzi
2017-07-11 19:07 migrating from Delayed Jobs to Sidekiq »
I am migrating from Delayed Jobs to Sidekiq. There are some spec that I already have and I also want to change them to become compatible with sidekiq....
(2) odpowiedzi
2017-07-11 19:07 Rspec raise_error do not work with custom errors »
I have a custom error class ApiError: class ApiError < StandardError attr_reader :message, :code, :details, :raw_json def initialize(json) ...
(2) odpowiedzi
2017-07-11 18:07 How to validate presence of an array in Rails with Rspec? »
My specs work fine validating login and in that validation I have access to some_array but in the validation for some_array it fails because I don't h...
(1) odpowiedzi
2017-07-11 17:07 uninitialized constant User::FavoriteRecipe »
So I was trying to implement a favouriting system for an app of mine and followed this guide: The particular setup you describe mixes several types o...
(0) odpowiedzi