Data dodania Pytanie
2017-02-18 20:02 Read data from csv file with foreach function »
I have been reading data from csv, if there is a large csv file, for avoid this time-out(rack 12 sec timeout) i have read only 25 rows from csv after ...
(2) odpowiedzi
2017-02-18 20:02 Passing conditions to ActiveRecord_Relation .order - Rails 4 / Postgres »
I am using STI on a table called Clients. Clients has a boolean attribute called is_additional. How can I call .order on an AR Relation for primary a...
(0) odpowiedzi
2017-02-18 18:02 Ruby: access values through tap »
I've got a Calculator class that reads like so: class Calculator DEFAULTS = { price: 4.25, size: 10000 }.freeze def initialize(lead) @...
(1) odpowiedzi
2017-02-18 16:02 Sidekiq active job , how to run one job at a time? (non-concurrent run) »
so, i have this job where it is able to be requested multiple times. however, when i run sidekiq, i want the jobs to be run one job at a time, in a qu...
(1) odpowiedzi
2017-02-18 14:02 rspec capybara tests only showing "data:," in chrome then failing with EOFError »
Our rspec feature specs that use capybara and chromedriver run fine locally on my mac or in my vagrant Ubuntu environment. Until recently they also wo...
(1) odpowiedzi
2017-02-18 14:02 Sidekiq Active job function perform_later not working »
so this is my first time working with an active job. I chose the sidekiq adapter , and currently i am having this issue. I want to queue up my jobs ...
(1) odpowiedzi
2017-02-18 12:02 How to parse email or phone number parameter? »
The parameter email_or_phone_number comes from a client side and I need this for an authentication. However, the model has email and phone number fiel...
(3) odpowiedzi
2017-02-18 09:02 Rails Query with nested association and group ( by associated object) »
Given this model relationships: orders.rb belongs_to user user.rb belongs_to company company.rb has_many users I wanted to count all orders made...
(1) odpowiedzi
2017-02-18 03:02 Rails: Apply order by params on a custom search function »
My project is a rails classified website, I wrote a custom search function in my model Listing def self.search(params) listings = Listing.where(c...
(0) odpowiedzi
2017-02-18 01:02 Rails order results with multiple joins to same table »
--Edit-- I wanted to simplify this question. With this model structure: has_one :pickup_job, class_name: 'Job', source: :job has_one :dropoff_job, c...
(2) odpowiedzi
2017-02-17 22:02 OwlCarousel Not Showing Chartkick graphs »
In my Ruby on Rails application I am trying to use OwlCarousel to display a slideshow containing pie charts that have been generated using ChartKick. ...
(0) odpowiedzi
2017-02-17 18:02 Rspec: Using factories in other factories »
I'm writing a cost for a create method that will add a comment to a post. The comment belongs to a user and a post. And a post belongs to a user. Wh...
(1) odpowiedzi
2017-02-17 16:02 External web service for sending background emails in rails »
I've used this instructions and sent "Welcome" mail to my signed up user. But this makes the user wait for 5-8 seconds because the server is trying to...
(1) odpowiedzi
2017-02-17 12:02 How to automatically fill in the form with data from other models in Rails »
I'm new to Rails. I'm trying to make an app where students can login in and signup for the exam. I have the following models and controllers which are...
(1) odpowiedzi
2017-02-17 10:02 Check for hardcoded text in Rails views - I18n »
some of our devs (me included) don't always take it serious to put text in a localization file, result is a lot of hardcoded texts scattered around a ...
(2) odpowiedzi
2017-02-17 10:02 RSpec test fails with NoMethodError »
I have a model domain.rb class Domain < ActiveRecord::Base belongs_to :user has_many :ranks, dependent: :destroy validates_uniqueness_of :n...
(1) odpowiedzi
2017-02-17 10:02 Format a string containing Phone numbers »
I have a string containing phone numbers separated by ,, phone = "08763843478,+918763843478,08763843478,+918763843478,+918763843478" I want to form...
(2) odpowiedzi
2017-02-17 06:02 ArgumentError when storing point using RGeo »
I'm having some trouble storing a point in RGeo. initializer/rgeo.rb RGeo::ActiveRecord::SpatialFactoryStore.instance.tap do |config| # By default...
(0) odpowiedzi
2017-02-17 06:02 How do I avoid test duplication? »
This code appears in two of my specs: it 'does not add the reply' do expect { subject }.not_to change { replies.length } end it 'does not publish ...
(1) odpowiedzi
2017-02-17 02:02 How to run coffeescript on page change? »
I'm working on a Rails 4 app without turbolinks. I know I can tell my coffee script to run with: $(document).ready -> $('.toggle_stage_item_edi...
(1) odpowiedzi
2017-02-17 00:02 Disconnecting mysql connections in ruby after a timeout »
My network firewall kills any idle connections after a few minutes. This is causing our rails app to keep reconnecting and eventually the database sta...
(0) odpowiedzi
2017-02-16 21:02 Reblog a post when user repost from another user timeline »
I need to enable a functionality like tumblr or similar blogs, where the the user can see the original poster (creator) and the user who reposted. e....
(0) odpowiedzi
2017-02-16 20:02 `dispatch_request': no such request during Net::SFTP.upload »
I'm using Net::SFTP to upload a file to a server. Here is the code: uri = URI.parse('sftp://host.org') io = StringIO.new(csv_string) timeout 120 do ...
(1) odpowiedzi
2017-02-16 20:02 How to save 'Yes' or 'No' instead of 'true' or 'false' with Rails check_box form helper? »
I have an object @recipient with attribute responding. Say, I want responding to store "Yes" or "No" via =f.check_box :responding, {}, 'Yes', 'No', wh...
(2) odpowiedzi
2017-02-16 12:02 ActiveRecord & Postgresql: Query jsonb attribute »
I have a model Characteristic, with a equivalent attribute which is a jsonb value. ex: characteristic1: id:1 equivalent: {list: ['first', 'second'...
(1) odpowiedzi
2017-02-16 11:02 Validate params based on condition in rails-grape »
I am developing APIs for a web app. In one specific case I am facing a situation where I require param2 only when value of param1 is false. I was able...
(1) odpowiedzi
2017-02-16 11:02 Why my user_id is updated to null? »
I have 2 model one for user(amitians) other is about.rb to store their details they have a has_one relationship between them but problem is whenever I...
(1) odpowiedzi
2017-02-16 07:02 Any issues with storing emails as down-cased? »
From time to time, I notice user emails are duplicated. Even with model validation (app level) to check for uniqueness. I suspect this is related to c...
(0) odpowiedzi
2017-02-15 20:02 rails undefined method `[]' for nil:NilClass on association »
After place a association images right after save the product, rails spitting out about method `[]' for nil:NilClass, why is showing nil, for a assoc...
(1) odpowiedzi
2017-02-15 18:02 Rails 5 includes and polymorphic »
I'm using Rails 5 and try to do next class Song has_and_belongs_to_many :artists end class UnknownSong end class Library belongs_to :media, pol...
(0) odpowiedzi
2017-02-15 17:02 Check if user confirmed during login, using devise »
I have a React+Rails app and I'm using devise for authentication. I'm trying to generate a custom error message for users who try to login after their...
(2) odpowiedzi
2017-02-15 16:02 Download single record in CSV in Rails »
I'm using ruby csv library. When I'm trying to download multiple records it is working fine and downloading all the records in CSV file. @assets = As...
(1) odpowiedzi
2017-02-15 16:02 How to validate regular expression (custom validator) using shoulda-matchers? »
I have a custom email validator (see below), class EmailValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) u...
(0) odpowiedzi
2017-02-15 15:02 It is possible to use the new ActiveRecord::Attributes API in a PORO? »
I usually include ActiveModel::Model into some PORO (for example for a FormObject::SignUp). I've read about the new Rails 5 ActiveRecord::Attribute A...
(2) odpowiedzi
2017-02-15 13:02 Automating pairing in ruby on rails database »
I have a site where users can register and view thgeir profile with their data showing.. I created two columns paid which is boolean(default: false) a...
(0) odpowiedzi