Data dodania Pytanie
2017-02-11 05:02 How to express the variable in absolute value form »
'This is the variable which I want to express in absolute value . <%= rate-32.5 =%> However ,I tried <%= |rate-32.5 |=%> It doe...
(4) odpowiedzi
2017-02-11 04:02 How to find number of records based on association through join table »
I have User, Assignment, and Account models. Users can belong to many accounts and accounts have many assignments. As an admin on an account you can '...
(2) odpowiedzi
2017-02-11 04:02 Rails4: Use two types of background job engines in one RoR application »
As far as I know Rails provides active job for the background job interface. We could use Delayed Job, Resque, Sidekiq. For now, I use Sidekiq and e...
(0) odpowiedzi
2017-02-11 01:02 Monit and private_pub »
to start the thin server with monit is just start program = "/etc/init.d/thin start" but to start private_pub or faye is needed to bundle the rackup....
(1) odpowiedzi
2017-02-11 01:02 Bundler::GemRequireError: There was an error while trying to load the gem 'omniauth-oauth2' »
I have a bizzare error and i do not seem to find any way to fix it. Basically my heroku deployment fails with that message. More: Removing bourbon (...
(2) odpowiedzi
2017-02-11 00:02 How can I use JSON data with Ruby? »
This seems really simple but I've looked all over and I can't find any documentation for this. I have the following json file: //data.json { "movi...
(1) odpowiedzi
2017-02-10 21:02 Rails 3 to 4 migration uniqueness validation issues »
Context We are migrating from Rails 3.2.12 to 4.0.2 and Ruby 1.9.3 to 2.1.8. We have a lot of test coverage to accomplish the migration in the form ...
(0) odpowiedzi
2017-02-10 20:02 Shortcut for conditional variable manipulation in Ruby/Rails »
One of the parameters my API controller receives has a big key name and I need to convert it from string to integer, if it is present, before sending ...
(1) odpowiedzi
2017-02-10 16:02 How to write standalone scripts in ruby and call them in rake tasks and what is a standalone scripts »
I want to write standalone script in ruby on rails and want to call it in rake task. I have seen lot of post about standalone scripts but nothing seem...
(1) odpowiedzi
2017-02-10 14:02 Rails - how to incorporate 'quantity' bookings using counter_cache and update correctly »
I'm building an events app using Rails and have added a counter_cache association between my Event and Booking models in order to capture the number o...
(1) odpowiedzi
2017-02-10 12:02 Can't get a link render properly on email »
I am trying to construct a string that will be passed to UserMailer as the body of the email. Here is the code: html_text = "" topic_object.title = ...
(1) odpowiedzi
2017-02-10 09:02 What is the best approach to test JSON API using RSpec request spec »
I find it troubling to test JSON API using RSpec request spec (see code below), because I have to create the required parameter every time (valid_attr...
(1) odpowiedzi
2017-02-10 03:02 How do I write an RSpec test that confirms Password Reset Token has been Saved to the DB? »
I'm writing a test for my Rails 5 API to confirm a password_reset_token is generated whenever a user requests a password reset. I have a short passw...
(1) odpowiedzi
2017-02-10 01:02 gem install libv8 -v '5.3.332.38.1' ... Error installing libv8: ERROR: Failed to build gem native extension »
Any ideas/suggestions? **** Further update:**** 2.3.1 agxxx-xxxight 2290-fix-claim-button % ruby -e 'puts Gem::Platform.local' x86_64-darwin-13 I h...
(1) odpowiedzi
2017-02-10 01:02 Migration in rails turns varchar with 1 character to boolean »
I have an oracle database. In the database there are no booleans. But after I migrated to rails, the VARCHARS with 1 character became boolean. How do ...
(1) odpowiedzi
2017-02-09 23:02 Ruby on Rails - Adding data to model from Javascript »
I'm trying to implement a tag/category system using tag-it, but I'm unsure the best method I should be using to pass the data back to the model. Curr...
(0) odpowiedzi
2017-02-09 23:02 Use RSpec to test for DeserializationError »
I have a job that is enqueued. Sometimes, the record associated with that job is destroyed before the job is ran. To resolve any ActiveJob::Deseriali...
(0) odpowiedzi
2017-02-09 22:02 How to use ActiveJob in combination with accepts_nested_attributes_for »
Given the following example model: class Foo < ActiveRecord::Base has_many :foobars has_many :bars, through: :foobars accepts_nested_attribu...
(0) odpowiedzi
2017-02-09 19:02 How to change domain.com to staging.domain.com in Ruby on Rails on Apache »
We have a production website that is located at domain.com. I would like it to be staging.domain.com. The website is written in Ruby on Rails, and it...
(0) odpowiedzi
2017-02-09 17:02 Apply defaults to namespaced ActiveRecord translations »
I have some models with a price attribute, which I want to translate. In my locales file, I have this translation: de: activerecord: attribute...
(1) odpowiedzi
2017-02-09 15:02 Delete other user except current_user in rails app using devise gem »
I am trying to list all the users who are using my application and delete only those that i want. But every time when i try to delete my user it passe...
(3) odpowiedzi
2017-02-09 14:02 How to use before_action on Doorkeeper::TokenController »
I'm having trouble with Doorkeeper::TokensController. I want to execute some code before an Access Token is asked for (if it's created or not, I want ...
(1) odpowiedzi
2017-02-09 14:02 Rails - counter_cache not working »
I'm building an events app using Rails and have added a counter_cache association between my Event and Booking models in order to capture the number o...
(1) odpowiedzi
2017-02-09 14:02 Http testing my ruby based API »
I'm trying to test my ruby API, but I m facing some difficulties to send the right data format. I can easily create a desired data format from rspec c...
(1) odpowiedzi
2017-02-09 11:02 Rails: How to write model spec for this method? »
I've just started to take on my first model spec task at work. After writing a lot of feature specs, I find it hard to get into the different perspect...
(1) odpowiedzi
2017-02-09 10:02 find_or_create_by trying to create duplicate records with hmt association »
I'm curious if there is another way of achieving the following. Setup: class Cabin < ApplicationRecord has_many :feature_groupings has_many ...
(1) odpowiedzi
2017-02-09 09:02 RSpec/Capybara does not commit to DB within test »
I'm quite desperate since moving our test suite from Minitest to RSpec. All the controller and model tests run fine so far, but since trying to port (...
(1) odpowiedzi
2017-02-09 00:02 Rufus cron scheduling not working on a jetty server »
Steps to replicate: Create a new Rails project. (rails 3.2.22.5) Add dependencies (warbler, rake, rufus-scheduler) (/Gemfile) JRuby 9.1.7.0 Create...
(2) odpowiedzi
2017-02-08 23:02 Build up help for TDD/BDD with RSpec »
For about 2 weeks ago i've started learning Ruby, i've made an WebParser / Page WordCounter using 'open-uri' and 'nokogiri'. So i just run up the term...
(1) odpowiedzi
2017-02-08 22:02 Multiple LIKE and AND operators in RAILS/POSTGRESQL »
I'm using Rails 5.0.1 and Postgresql as my database. I have a table with column :content which contains words. The problem: When I'm looking for a sp...
(3) odpowiedzi
2017-02-08 18:02 Why is Rufus scheduling the job twice? »
Steps to replicate: Create a new Rails project. (rails 3.2.22.5) Add dependencies (warbler, rake, rufus-scheduler) (/Gemfile) JRuby 9.1.7.0 Create...
(1) odpowiedzi
2017-02-08 18:02 Rails has and belongs to many duplicate entries »
I have 2 models and a join table('email_addresses_mailable_events'). Database being used is Postgres. class MailableEvent < ApplicationRecord ...
(0) odpowiedzi
2017-02-08 17:02 RSpec cannot find route for nested resource »
I'm dealing with a seemingly strange issue while trying to run unit tests on a nested resources controller. Here's my setup: routes.rb: Rails.applic...
(1) odpowiedzi
2017-02-08 16:02 Ruby unicorn needs to debuggin - server cpu goes 100% »
We have a ruby api server which was working perfectly fine, there was a problem with the elastic search server After fixing this, the server cpu goes ...
(0) odpowiedzi
2017-02-08 15:02 Remove before_validation callback in rails using class_eval »
I have a class in my model written inside a vendor's code(which I cannot modify) which has a Proc attached to it. Considering an example for a shirt c...
(2) odpowiedzi