Giter VIP home page Giter VIP logo

rom_factory's Introduction

rom_factory's People

Contributors

janjiss avatar timriley avatar wilsonsilva avatar

Stargazers

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

Watchers

 avatar  avatar

rom_factory's Issues

Move to rom-rb?

Hey, first of all - thank you for kick-starting this project. We're using it at Icelab, and it's been helpful. I started making some tweaks and improvements, and started wondering if you'd be interested in moving this project over to rom-rb organization, so that we can work on it together and increase its visibility. This is a crucial part of the stack and it'd be good to have it as an official gem in the org, and so that we can develop it faster.

Here's roughly what I'm thinking about in terms of improvements:

  • rename it to rom-factory, because right now it doesn't follow rubygem naming conventions
  • improve DSL so it's easier to use (we've done it in a private project already, and would like to OSS it)
  • add integration with faker (also done in our priv project)
  • separate pure data generation from persistence, so we can generate data for structs too
  • make generated structs compatible with dry-struct (or even add support for generating dry structs)
  • add support for generating aggregates too (this one will be more tricky)

WDYT?

Add support for ROM Mappers

It would be a good idea to support ROM Mappers for entities.

So, when you do:

let(:user) { RomFactory::Builder.create(:user) }

it returns a new User instead of a RomFactory::Struct. What do you think @janjiss ?

Define an optional rake or generator to set up rom_factory

It will be awesome to have a rake or generator task that sets the rom_factory basic configuration, like:

Create -> ../config/initializers/rom_factory.rb
Inside it, for example Hanami setup:

RomFactory::Config.configure do |config|
config.container = Hanami::Repository.container
end

Create -> ../spec/rom_factories/

Command line, something like:

% rake rom_factory:install hanami(whatever framework)
% hanami(whatever framework) generator rom_factory

Create a default directory to put the rom factory files

When creating a rom factory definition, will be great to place it inside files and organize them into a directory like FactorGirl does.

../spec/factories/
-users.rb
-clients.rb

Actual result: Place rom factory definition inside the spec file

Expected result: Place rom factory in a file inside a tree directory structure.

Assume default value to created_at and updated_at attributes

When creating a factory it should take on a default value to created_at and updated_at attributes.

Actual Result: Sequel::NotNullConstraintViolation: PG::NotNullViolation: ERROR: null value in column "created_at" violates not-null constraint

Expected Result: set "created_at" column with current DateTime automatically.

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.