Questions tagged as 'ruby-on-rails'

1
answer

Bcrypt - Automating password encryption process

Hello. I already have a column in my bank called password. Use devise for authentication, so it created another column called encypted_password. Even if I copy all the password values and play to encrypted_password, I would have to face an error...
asked by 04.01.2017 / 19:13
2
answers

How to return api data translated with i18n?

My API returns serialized data with active_model_serializers , some of these attributes are translated into the frontend using angular-translate . The dictionary containing the translations is growing, I want to translate this dat...
asked by 19.02.2017 / 20:24
1
answer

How to do a data migration routine?

Suppose I have one registration model and one user model. How do I get each registration record sent to the users? This should also be done with each new record that is created in the registry, it must be migrated to the user model. I'm new t...
asked by 28.12.2016 / 19:31
1
answer

How to do eager_load with nested controllers?

In the index method of controller Disputes::ConferencesController ready all conferences of disputes . The URL address is disputes/1/conferences . My route plan looks like this: resources :disputes do scope module...
asked by 28.12.2016 / 14:04
1
answer

Ruby on Rails, how to improve the performance of the Hash transformation for ActiveRecord?

Personally I have a performance problem when transforming a hash to the activerecord model objects, the hash is returned by the gem savon after consuming a web service. The benckmark has a relatively high time for the hash size that is 0.25sec f...
asked by 23.12.2016 / 23:18
1
answer

NoMethodError: undefined method 'send_data' for CloneDatabase: Class

Rails does not find method send_data clone_database.rb require 'zip' class CloneDatabase < ApplicationController def self.make_clone zip_data = 'a'.to_json send_data zip_data, type: 'application/zip', filename: 'Topic...
asked by 12.12.2016 / 18:03
1
answer

Authentication and user permission

Hello. I'm setting up a system for registration and updating, it would work as follows User logs in and receives a screen to edit his own register, only. But I have a question. As I am new to Rails , I have been getting tools for authoriz...
asked by 12.12.2016 / 21:57
1
answer

How to remove upload files after the db: drop command in Rails?

My API uses the gem shrine to effect many different types of uploads. Unfortunately during development the files are accumulating in the public/uploads folder every time I db:drop of the database and re-runs. My Factory Girl i...
asked by 03.01.2017 / 14:57
1
answer

How do I enable Rails to support multiple connections open to the database?

I use PostgreSQL in my API and if my GUI (Navicat) is open accessing the application database and try to run the command db:drop db:create db:migrate db:seed I get the error below: ActiveRecord::StatementInvalid: PG::ObjectInUse: ERROR:...
asked by 03.01.2017 / 12:00
1
answer

How to return the correct location for route with singular resources?

When using the controller name in the singular, the route is prefixed with _index to the end of the route name (eg dispute_conference_index ). Within the controller in method create the parameter location in render...
asked by 02.01.2017 / 17:15