Code Monkey home page Code Monkey logo

cache_fu's People

Contributors

defunkt avatar dustin avatar lovitt avatar technoweenie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cache_fu's Issues

tests fail/ Rails site fails

I cant seem to get cache_fu going. I inherited a site that had to be moved over locally and it keeps failing with this error:

  1. Error:
    test_spec {When local_cache_for_request is called} 001 [get_cache should pull from the local cache on a second hit](When local_cache_for_request is called):
    NoMethodError: undefined method []' for #<Enumerable::Enumerator:0x7f3aa057cbf0> /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/core_ext/string/access.rb:43:infirst'
    ./lib/acts_as_cached/cache_methods.rb:184:in cache_key' ./lib/acts_as_cached/local_cache.rb:7:infetch_cache'
    ./lib/acts_as_cached/cache_methods.rb:31:in get_cache' ./lib/acts_as_cached/cache_methods.rb:230:inget_cache'
    test/local_cache_test.rb:13:in test_spec {When local_cache_for_request is called} 001 [get_cache should pull from the local cache on a second hit]' /usr/lib/ruby/gems/1.8/gems/test-spec-0.3.0/lib/test/spec.rb:442:inrun'
    /usr/lib/ruby/gems/1.8/gems/test-spec-0.3.0/lib/test/spec.rb:441:in each' /usr/lib/ruby/gems/1.8/gems/test-spec-0.3.0/lib/test/spec.rb:441:inrun'
    /usr/lib/ruby/gems/1.8/gems/test-spec-0.3.0/lib/test/spec.rb:442:in run' /usr/lib/ruby/gems/1.8/gems/test-spec-0.3.0/lib/test/spec.rb:441:ineach'
    /usr/lib/ruby/gems/1.8/gems/test-spec-0.3.0/lib/test/spec.rb:441:in `run'

I am using:

  • memcache-client (1.7.5)
  • rails (2.0.2)
  • cache_fu verison??

Any help would be greatly appreciated.

avoid overriding the "cache_key" method for ActiveRecord::Base children

recent rails versions come with a nice cache_key method that concatenates

class_name + id + timestamp

this together with the ActiveRecord "touch" method would work great because
cache expiration is automatic when the record gets updated.

this method "cache_key" is being overwritten in the "cache_fu" plugin.

lib/acts_as_cached/cache_methods.rb:265

265     def cache_key
266       self.class.cache_key(cache_id)
267     end

I was thinking that maybe something like this would do:

return super if self.class.superclass.to_s == 'ActiveRecord::Base'
self.class.cache_key(cache_id)

So well, may be it needs a little bit more code and tests to be robust.
but you sort of get the idea.

I forked, and was thinking of making the changes but thought of confirming this

Thanks for rip, cijoe, network-graphs?? and more!

Tests don't pass

How exactly do you get the tests to pass? This is the output from when I run them:

36 tests, 20 assertions, 6 failures, 16 errors

I would past the entire output, but it's amazingly long. Do the tests depend on a certain version of Ruby? Or... certain rails versions? I've tried with Rails 1.2.5, 2.2.3, 2.3.2, and 2.3.4. I'm running REE 1.8.7. I've installed the exact versions that the test helper says I need of required gems.

I'm trying to get the tests to pass because I just want some validation that everything works. Specifically, I would like to get caches_action to work, which (as another issue logged here points out) seems to be broken. I intend to attempt the fix mentioned in that linked blog post, but in the meantime, it seems like the tests should pass...

cache_fu's config is conflict to config in rails3

when i do:
rake db:migrate RAILS_ENV=development

then a error Occur:
rake aborted!
undefined method `cache_classes=' for #Hash:0x10107bd98

i check it,and got the cache_fu have a config
module ActsAsCached
@@config = {}
mattr_reader :config

and the rails3 define it's config.
EoeUnion::Application.configure do

Settings specified here will take precedence over those in config/environment.rb

In the development environment your application's code is reloaded on

every request. This slows down response time but is perfect for development

since you don't have to restart the webserver when you make code changes.

config.cache_classes = false

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.