I've used various forks (mostly the ngmoco fork) of Nick Kallen's excellent cache_money for several Rails 2.3 based project, but we're now making the leap to Rails 3 which, thanks to the introduction of ActiveRelation, does not work with the popular forks of cache_money.
Is there a fork of cache_money, or an equivalent write-through cache, that is compatible with Rails 3 ?
Last week I launched a new write-through-cache gem for Rails 3, see https://github.com/orslumen/record-cache.
The reason I built it, is because we were using cache money and recently migrated to Rails 3. So chances are it may also serve you well.
There are a branch rails 3 in ngmoco fork to use you :
http://github.com/ngmoco/cache-money/tree/rails3
You can try it I don't know if it's really works.
You can add this in your Gemfile by
gem 'cache_money', :git => 'git://github.com/ngmoco/cache-money.git', :branch => 'rails3'
second_level_cache is also a gem inspired by CacheMoney.
Related
We have a product that has been built using the milia multi-tenanting gem (https://github.com/jekuno/milia) . Unfortunately it seems this gem is dead. We can't upgrade past Rails 5 because of this.
Is there any way to move from milia to another gem (eg apartment https://github.com/influitive/apartment - though I see that hasn't been updated in 2 years either!) and not force everyone to recreate passwords etc?
I ended up modifying Milia to work with Rails 6.
That new gem is called Philia
Had the same issue trying gem milia had to use acts_as_tenant- which is well upto date and supports rails 5.2 upwards and its syntax close to gem 'acts_as_tenant'
https://github.com/ErwinM/acts_as_tenant
I am using client validation rails gem and I got this error. Any idea.....
wrong number of arguments (3 for 2)
Extracted source (around line #1):
<%= form_for #user, :validate => true do |f| %>
Trace of template inclusion: app/views/users/new.html.erb
Rails 4 Support
Thanks to tagliala & bcardarella, the client_side_validation gem now supports rails 4!
After adding
gem 'client_side_validations'
to my Gemfile, it didn't load everything properly.
This may be temporarily, as Rubygems only links the old version.
Instead I had to specify the exact repository & branch, since the owner changed.
gem 'client_side_validations', github: "DavyJonesLocker/client_side_validations", branch: "4-2-stable"
Based on https://github.com/bcardarella/client_side_validations/issues/494 it looks like CSV will not support Rails 4 for a little bit longer.
However it also states
I don't see CSV 4.0 coming out for at least 2 months after Rails 4.0 lands (hopefully not that long) as there will be major changes on the JavaScript side of things. Because it will take so longer and people will want a Rails 4.0 compliant version of CSV suggesting they use master branch or perhaps releasing a alpha or pre version to partially satisfy them while we update might be the correct option.
So perhaps try pulling csv right from git? There is a 4.0 beta branch that might be worth trying...
Update
The CSV gem is no longer actively maintained. There are 3 different 4.0 branches on the repository, and the most recently updated of which is 4-0-useable (https://github.com/bcardarella/client_side_validations/branches/all).
Update 2
As #TheChamp says, the CSV gem now supports rails 4.2!
If your using Rails 4 then Client Side validation is outdated. You can check here
http://railscasts.com/episodes/263-client-side-validations?view=comments
and also if you go to the github page
https://github.com/bcardarella/client_side_validations
you can see that it says its no longer maintained.
Alternatively you can try using the CSV gem from this branch, by replacing the CSV line in your Gemfile by this
gem 'client_side_validations', github: "bcardarella/client_side_validations", :branch => "4-0-beta"
Not sure even if this will work though. Since its outdated.
Or you can check this gem out,
https://github.com/kalkov/rails4_client_side_validations
Its just a modified version of Client Side Validations
Have you followed all of the instructions on the github page? If so, have you restarted your server? The install adds an initializer that wont take effect until a server restart.
I need the functionality provided by the rails_sql_views gem. However it looks like the last commit for this gem was made in 2010. Has this project been outdated by a new project? I'd like to find an active gem to use to get this functionality.
http://activewarehouse.rubyforge.org/rails_sql_views/
http://rubygems.org/gems/rails_sql_views
After further research here is a Rails 3 candidate for similar functionality:
https://github.com/bradphelan/Active-Illusion
This is a gem of this blog post:
http://xtargets.com/2011/08/02/tableless-views-with-active-record/
However this solution doesn't seem to be very popular.
schema_plus gem has create_view method that seems compatible (although I'm not familiar with rails_sql_views).
barancw, I needed this gem for our product using Rails 3.2.5, so I forked the repo and updated the necessary pieces. This gem is great for improving the performance of our large database queries, as it reduces the need to load objects into memory. I combined this gem with another optimization: Rails - given an array of Users - how to get a output of just emails?
https://github.com/ryanlitalien/rails_sql_views
Original documentation: http://rubydoc.info/gems/rails_sql_views/0.8.0/frames/index
Please keep in mind the docs are a bit outdated ("require_gem" has been replaced with "gem" and add the gem to your Gemfile as well).
I recently learned Rails (Rails 3 to be specific) and got a small project maintaining a Rails 2.3.2 app.
So, as you might expect, I keep running into differences between what I learned in Rails 3 and what I'm working in.
For example 'rails server' command in Rails 3 is 'script/server' in Rails 2.x.
What else should I know to maintain my sanity?
If you're new to rails, I don't know if you'll see a lot of differences. The rails server command is one thing however.
The other big thing is the use of .gemspec in Rails 2.3.5 instead of Bundler and Gemfiles in Rails 3. Installing gems/specifying which gems your app uses is way better in Rails 3 I think.
The rest are mostly syntax changes and depreciated functions in specific areas (e.g. javascript generators).
This Blog does a good job of listing most of the major changes in more detail.
Hope that helps!
I recently booted up an old version of a Rails project of mine, which uses Rails 2.3.11 and realized that Rails 2.3 is much faster running almost the same code as the recent version.
My question: Is Rails 3 slower than Rails 2? Especially when rendering lots of partials? The old version never really exceeded 300ms for a request, Rails 3 takes 600ms and more, sometimes even 2 seconds. Any workarounds known? Or should I move my partials into helper methods (generating the html)? And no, downgrading is not an option!
Greetings, Mario
How are you rendering your partials? Rails in development mode can be quite slow. You can try giving this gem a try by adding this to your Gemfile: gem 'rails-dev-boost', :git => 'git://github.com/thedarkone/rails-dev-boost.git', :require => 'rails_development_boost'.
If you are running your partials via a collection, you can always do something like <%= render #posts %> for better performance gains.
Hope this helps!