Giter Club home page Giter Club logo

forceps's People

Contributors

aburgel avatar atipugin avatar hparker avatar jorgemanrubia avatar jstastny 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  avatar

forceps's Issues

Can not view all the models from Remote.

When I am trying Forceps.configure, I have like 15 models but I am getting messages for only 10 models i.e
DEBUG : Classes handled by Forceps: ["Delayed::Backend::ActiveRecord::Job", "PaperTrail::Version", "Role", "AdminUser", "User", "UserAttribute", "Plan", "Tag", "Question", "ActiveAdmin::Comment"]

Polymorphic STI models don't work

We're running into the issue where polymorphic STI associations do not work correctly. Here is an example, taken from the tests. I've converted project_id on LineItem to subject_id and subject_type, giving us:

class LineItem < ActiveRecord::Base
  belongs_to :subject, :polymorphic => true
end

class Product < ActiveRecord::Base
  has_many :line_items, :as => :subject
end

However, when I try to load a generated LineItem's subject, I get:

#<RemoteLineItem id: 1, quantity: nil, subject_id: 3, invoice_id: nil, created_at: "2014-08-14 22:48:42", updated_at: "2014-08-14 22:48:42", subject_type: "Cars::German::SportsCar">
#<Forceps::Remote::LineItem id: 1, quantity: nil, subject_id: 3, invoice_id: nil, created_at: "2014-08-14 22:48:42", updated_at: "2014-08-14 22:48:42", subject_type: "Cars::German::SportsCar">

# But if I ask the Forceps::Remote::LineItem about its subject_type, I get Forceps::Remote::Cars::German::SportsCar due to reference_remote_class_in_polymorphic_association.  But if I ask it for subject, I get:

ActiveRecord::RecordNotFound: Couldn't find Forceps::Remote::Cars::German::SportsCar with id=3 [WHERE "products"."type" IN ('Forceps::Remote::Cars::German::SportsCar')]

Which makes sense because the type in the remote db would be Cars::German::SportsCar. Do I need to copy the subject first, then somehow update reference_remote_class_in_polymorphic_association and make_type_attribute_point_to_local_class_if_needed?

Support for multiple database connections

Hiya, awesome looking gem. How hard do you think it would be to support multiple remotes? Our app connects to a bunch of databases:

class OtherModel < ActiveRecord::Base
  establish_connection 'other_database'
end

undefined method `reflections='

I'm getting following error right after calling Forceps.configure:

NoMethodError: undefined method `reflections=' for #<Class:0x007fa9dced9e18>

Rails 4.1. Any suggestions?

Support for Rails 5?

I use Rails 5. When I run Forceps.configure I get ActiveRecord::AdapterNotSpecified: database configuration does not specify adapter. I get this error before or after adding the remote node to database.yml.

Does not work with many-to-many association

The forceps gem does not recognize many-to-many association and skips the model while copying.

class Cat < ActiveRecord::Base
  has_and_belongs_to_many :family_members
end

class FamilyMember < ActiveRecord::Base
  has_and_belongs_to_many :cats
end

When we try to access Forceps::Remote::Cat it raises the error:
NameError: uninitialized constant Forceps::Remote::Cat

Support for namespaced models?

Hi there,
I'm getting an error when calling Forceps.configure

NameError: uninitialized constant Forceps::Remote::Product_FramePhoto

The class is Product::FramePhoto, do I have something configured incorrectly or does forceps not support namespaced models?

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.