Data dodania Pytanie
2017-11-29 16:11 Rails 5 Migration Data Type Issue »
I originally developed my rails 5 application using PostgreSQL. I had to change over to a MariaDB after I had done all of my development due to some i...
(1) odpowiedzi
2017-11-29 16:11 user is not sign in as devise user when authenticated from omniauth facebook? »
I have integrated the omniauth-facebook in my application to authenticate the user. It is working fine but there is one problem that user is not sign ...
(0) odpowiedzi
2017-11-29 07:11 Ruby: What does binds mean in ActiveRecord gem? »
I saw binds as argument in lots of methods, but without any documentation. e.g. Rails Source code def find_by_sql(sql, binds = [], preparable: nil,...
(1) odpowiedzi
2017-11-29 07:11 How to call same methods inside and outside 'context' and 'it' block »
Below is a simple rspec example: describe 'Emails' do email_ids.each do |email_id| it "should display #{email_id}" do end end...
(4) odpowiedzi
2017-11-28 23:11 Ruby, query active model dynamically »
I have an Order model in my ruby on rails application which has several attributes. I want to query those orders according to parameters given by user...
(1) odpowiedzi
2017-11-28 20:11 Add usernames to database »
I have this line in an .erb file to get the input of the username <input type="text" placeholder="User Name" name="user[username]" value="<%#{@...
(0) odpowiedzi
2017-11-28 19:11 Using 'case' with multiple conditions »
I'm trying to write a case statement which looks at two conditions, like this: roll1 = rand(1..6) roll2 = rand(1..2) result = case[roll1, roll2] w...
(5) odpowiedzi
2017-11-28 08:11 Class variables leaking when defined from a module? »
Consider that I have a module XYZ. When included in a class, it extends the base class and adds a class variable @@foo inside it. It also extends the ...
(1) odpowiedzi
2017-11-28 08:11 Using the id of subject{create()} in rspec »
I'm pretty new to rspec so I'm not sure how to word this properly so I'll give an example of my situation instead: subject(:test) { SomeModel.create(...
(0) odpowiedzi
2017-11-28 08:11 Removing all database access capability from rails 5.x client app »
I am still fairly new to ruby and Ruby on Rails framework. Rails --api only project is great for just getting into bare bones rest API development wi...
(0) odpowiedzi
2017-11-28 07:11 Ruby error : undefined method `any ' for 30:Fixnum (NoMethodError) »
I am trying to list the product reviews in spree back end. But getting the error 'undefined method any '. I am new to ruby,please help me to solve thi...
(2) odpowiedzi
2017-11-28 05:11 How to import ruby RSpec data »
Can someone please show how to directly import ruby RSpec data . I haven't found a single answer to this after hours of research. I'm trying to retu...
(1) odpowiedzi
2017-11-27 22:11 Jenkins build succeeds on syntax error in tests »
Whenever I push to GitHub, a Jenkins job runs that runs the command bundle exec rspec. However, if I have a syntax error in one of my test cases, the ...
(0) odpowiedzi
2017-11-27 22:11 Chrome 62 and flash »
I have a flash based app that i need to test using Cucumber. As flash is not enabled by default i need to enable it before each test and whitelist the...
(2) odpowiedzi
2017-11-27 21:11 Querying an Associations::CollectionProxy »
If I have a an Associations::CollectionProxy [#ModelName id: 1, name: my_model, #ModelName id: 2, name: my_model2] Would the following make a db ...
(1) odpowiedzi
2017-11-27 21:11 Supporting Multiple Cookie Domains with Rack::Session:Cookie and Sinatra »
We have a customer that we support on a subdomain of our mains site like this: them.us.com What they want is something.them.com We're using Rack...
(0) odpowiedzi
2017-11-27 18:11 Ruby aggregate function with model »
I have a product model in my ruby on rails application which has name,endorsement and expense attributes. I need to write a query that list all recor...
(3) odpowiedzi
2017-11-27 17:11 DEPRECATION WARNING: implicit join references. Rails don't want to be a SQL parser for includes »
I am upgrading an old app from rails3 to rails 4. Currently on rails 4.0 I have a lot of such deprecation warnings while running rspec: Currently,...
(1) odpowiedzi
2017-11-27 15:11 How to properly configure YT gem? Yt::Errors::Forbidden »
I am trying to use yt gem to access youtube API but I am having a problem. I have added gem: gem 'yt', '~> 0.28.0' Added configuration in applicat...
(1) odpowiedzi
2017-11-27 09:11 Ruby on rails active record queries which one is efficient »
I was recently working on a project where I faced a dilemma of choosing between two ways of getting same results. Here is the class structure: class ...
(5) odpowiedzi
2017-11-27 03:11 Sprockets Assets not compiled when visiting with Sinatra »
The issue I'm having is that the generated asset path does not point to anything -- my project directory doesn't change / sprockets doesn't build / co...
(1) odpowiedzi
2017-11-27 00:11 Rails: Active record query conditions only work if stated as sql -- using Globalize gem »
Not sure if there is a fix for this that you know of, but when using the the globalize gem class Menu < ActiveRecord::Base translates :name ...
(2) odpowiedzi
2017-11-26 23:11 Why does ruby’s `system` not `shellescape` the first argument? »
When referenced in a shell, directory names with parenthesis such as: /tmp/(example) need to be escaped like: /tmp/\(example\) When I reference ...
(1) odpowiedzi
2017-11-26 22:11 NoMethodError at before_save callback »
I'm getting this error message when submitting a form that creates an object and nested objects: NoMethodError (undefined method `ratio' for nil:NilC...
(1) odpowiedzi
2017-11-26 21:11 migrate is not running »
I made a model called user and in the timestamp_create_users.rb ( where timestamp = long number ) I have the following: class CreateUsers < Active...
(2) odpowiedzi
2017-11-26 18:11 Which part of the class name is a module? »
In a rails project I have the class: class Police::Office end Now I create an Interactor in the same namespace: class Police::Office::ConstructIn...
(1) odpowiedzi
2017-11-26 00:11 Bootstrap modal in ruby on rails not working(not show up) »
I am using rail4 and 'bootstrap-sass':'3.3.6'. I have followed steps in https://coderwall.com/p/ej0mhg/open-a-rails-form-with-twitter-bootstrap-modal...
(3) odpowiedzi
2017-11-26 00:11 Java JRuby differences in Multithreading »
I am new to JRuby and Ruby.Is there any difference in multi threading in JRuby and Java.As JRuby is just an implementation of Ruby on JVM where Java a...
(1) odpowiedzi
2017-11-25 23:11 In Ruby YARD docs, what it mean to wrap a word +example+ with + (plus sign)? »
In the official YARD docs, there is the following example: # @overload set(key, value) # Sets a value on key # @param key [Symbol] describe ke...
(1) odpowiedzi
2017-11-25 19:11 undefined method `exist?' - Feature... or bug? »
I found some unexpected (to me) behavior in Ruby. Is this behavior a bug or a feature? I stumbled on this situation while writing my project. To put ...
(0) odpowiedzi
2017-11-25 18:11 Save Model errors to flash Rails 5 »
I want to add hash with model errors to flash and after that redirect. This is the controller: def update current_user.update_attributes(user_par...
(1) odpowiedzi
2017-11-25 17:11 Secure Upload of an image with Carrierwave »
I'm trying how to secure my files upload with carrier wave, so I'm trying to following this code on this link of the carrier wave upload. config/initi...
(0) odpowiedzi
2017-11-25 16:11 Prevent identical pairs when shuffling and slicing Ruby array »
I'd like to prevent producing pairs with the same items when producing a random set of pairs in a Ruby array. For example: [1,1,2,2,3,4].shuffle.eac...
(4) odpowiedzi
2017-11-25 14:11 RSpec error: undefined method `include?' for nil:NilClass & undefined method `downcase' for nil:NilClass »
I'm learning Test Driven Development with Ruby and RSpec. My program should find a given word in the text. The first case should be falsey because t...
(1) odpowiedzi
2017-11-25 05:11 RSpec with FactoryGirl/Bot - undefined method 'user' on model that belongs to user through has_many :through »
Trying to get into proper testing and figure out the ins and outs of basic RSpec with FactoryBot. NOTE: The validation tests all passed previously an...
(2) odpowiedzi