Git Product home page Git Product logo

kakurenbo's People

Contributors

alfa-jpn avatar takaesu-ug 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kakurenbo's Issues

modelで継承した時に、親クラスをabstract_class=trueにした時の動作について

以下の様なことをしようとした場合、
kakurenboを使用していると、
子クラスでselectした場合、親クラスのselectが走っています。
確認いただけると幸いです。

» Railsで複数のデータベースを使用する TECHSCORE BLOG
http://www.techscore.com/blog/2012/12/12/rails%E3%81%A7%E8%A4%87%E6%95%B0%E3%81%AE%E3%83%87%E3%83%BC%E3%82%BF%E3%83%99%E3%83%BC%E3%82%B9%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B/

Ignores self.table_name on using PostgreSQL?

I'm using PostgreSQL. It seems that kakurenbo ignores self.table_name and cause SQL error. My model is coded as below.

class Admin < ActiveRecord::Base
  self.table_name = 'admin'
end

And when I run rails console and try below, it seems that kakurenbo tries admins table (plural, ignoring table_name) .

$ bundle exec rails c
Loading development environment (Rails 4.0.3)
irb(main):001:0> Admin.count
PG::UndefinedTable: ERROR:  relation "admins" does not exist
LINE 5:                WHERE a.attrelid = '"admins"'::regclass
                                          ^
:               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
                FROM pg_attribute a LEFT JOIN pg_attrdef d
                  ON a.attrelid = d.adrelid AND a.attnum = d.adnum
               WHERE a.attrelid = '"admins"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum

   (1.2ms)  SELECT COUNT(*) FROM "admin"
=> 3986

When I commented out gem 'kakurenbo' on Gemfile, it worked as I intended.

  • Ruby 2.1.1
  • Rails 4.0.3
  • PostgreSQL

Call destroy_all after 'where' to has_many associated member , ArgumentError has raised.

Hi.
I"m using this gem instead of acts as paranoid on Rails 4.1.7.
This gem is very useful, Thanks:)

By the way, I found the issue on calling destroy_all after 'where'.
You can reproduce this issue on this repo.
And I've created a patch to avoid this issue.
Please check it.

Regards.

P.S
I think this patch looks bad resolver because it can't do exhaustive test and lose maintenability.
It might be hard way that adding options to argument...

kakurenbo 0.2.2とpaper_trail 3.0.6でエラーとなる

いつも便利に使用させて頂いております。
paper_trailのバージョンアップにより、kakurenboでエラーとなるようです。
paper_trailが3.0.3時はエラーとならないようです。
確認お願いできますと幸いです。

バージョンは以下となります。
activerecord 4.1.4
paper_trail 3.0.6
kakurenbo 0.2.2

以下ログになります。

/project/vendor/bundle/ruby/2.0.0/gems/kakurenbo-0.2.2/lib/kakurenbo/mixin_ar_base.rb:28:in `remove_instance_variable': instance variable @table_name not defined (NameError)
    from /project/vendor/bundle/ruby/2.0.0/gems/kakurenbo-0.2.2/lib/kakurenbo/mixin_ar_base.rb:28:in `block in inherited'
    from /project/vendor/bundle/ruby/2.0.0/gems/kakurenbo-0.2.2/lib/kakurenbo/mixin_ar_base.rb:24:in `instance_eval'
    from /project/vendor/bundle/ruby/2.0.0/gems/kakurenbo-0.2.2/lib/kakurenbo/mixin_ar_base.rb:24:in `inherited'
    from /project/vendor/bundle/ruby/2.0.0/gems/paper_trail-3.0.6/lib/paper_trail/frameworks/active_record/models/paper_trail/version.rb:4:in `<module:PaperTrail>'
    from /project/vendor/bundle/ruby/2.0.0/gems/paper_trail-3.0.6/lib/paper_trail/frameworks/active_record/models/paper_trail/version.rb:3:in `<top (required)>'

Kakurenbo is broken in Rails4.1(activerecord4.1)

I want to use kakurenbo on Rails4.1(activerecord4.1) or more.
But environment of Rails4.1 was failed specs.

I sent pull-request just now, #7.

include the following:

  • adjustment travisCI settings
  • rspec3 support

As a result, I was found to have failed travisCI by activerecord environment.
https://travis-ci.org/alfa-jpn/kakurenbo/builds/28500214

activerecord version spec result
~> 3.2.16 failed
~> 4.0.2 success
~> 4.1.0 failed

Now, I work in progress to support Rails4.1 at my fork repository.
In reference to rubysherpas/paranoia@9dac34c

MyForkedRepository:
https://github.com/yusabana/kakurenbo/tree/support_activerecord4.0_over

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.