Top "Ruby-on-rails-4" questions

For issues specific to version 4 of Rails.

How get integer value from a enum in Rails?

I have a enum in my Model that corresponds to column in the database. The enum looks like: enum sale_…

ruby-on-rails ruby-on-rails-4
A copy of xxx has been removed from the module tree but is still active

I'm pretty sure the error has nothing to do with the actual content of the TenantIdLoader module. Instead, it has …

ruby-on-rails ruby ruby-on-rails-4
Saving enum from select in Rails 4.1

I am using the enums in Rails 4.1 to keep track of colors of wine. Wine.rb class Wine < ActiveRecord::…

ruby-on-rails ruby ruby-on-rails-4 enums
How do I clear my Rails file cache?

I’m running Rails 4.2.7 on Ubuntu 14.04. I have written the following method to help cache some data (preventing hits against …

ruby-on-rails ruby-on-rails-4 caching tmp
Rails 4 default scope

In my Rails app have a default scope that looks like this: default_scope order: 'external_updated_at DESC' I …

ruby-on-rails-4 default-scope
Rails console: Unable to autoload constant

I have a Customer_ratings model that allows users to leave feedback on each other. The web app is working …

ruby-on-rails-4 associations autoload rails-console
Default value for input with simple_form

im trying to do default value for input works ok: <%= f.input_field :quantity, default: '1' %> but …

ruby-on-rails ruby-on-rails-4 erb simple-form
Bundler could not find compatible versions for gem “railties” for Rails 4.0.0

I am trying to upgrade to Rails 4.0.0, and I changed the gem versions of sass-rails and coffee-rails. I need to …

ruby-on-rails ruby-on-rails-4 gem railtie
Disable ActiveRecord for Rails 4

I want to disable ActiveRecord in Rails 4. I did the following in config/application.rb require File.expand_path('../…

ruby-on-rails ruby ruby-on-rails-4
How to use dependent: :destroy in rails?

I have 2 models as describes below. class EmpGroup < ActiveRecord::Base belongs_to :user has_many :emp_group_members, dependent: :…

ruby-on-rails ruby ruby-on-rails-3 ruby-on-rails-4 ruby-on-rails-3.2