Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roadmap draft #14

Open
kirs opened this issue Oct 30, 2014 · 2 comments
Open

Roadmap draft #14

kirs opened this issue Oct 30, 2014 · 2 comments

Comments

@kirs
Copy link

kirs commented Oct 30, 2014

Me and @m-Peter discussed some plans about the future of activeform.

Composite resources

Imagine the case when in user signup form user can enter company name and the company will be automatically created:

class UserWithCompanyForm > ActiveForm::Base
  self.main_model = :user

  attributes :email, :password, :company_name, presence: true

  def save
    if @model.save
      Company.create(owner_id: @model.id, name: company_name)
      true
    else
      false
    end
  end
end

Instead of code above, we could provide some API.

Support other ORMs than ActiveRecord

Probably Mongoid and/or MongoMapper.

Guide about Form Objects on guides.rubyonrails.org

@wazery
Copy link

wazery commented Nov 26, 2014

@kirs I will try to implement an API for the "Composite Resources", will start searching and working on it now, hope you also check your email, as I did send you an email 😄

@kirs
Copy link
Author

kirs commented Nov 26, 2014

@wazery sure, you're welcome! You can also open new issue to discuss possible composite resources DSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants