Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

namespacing model attributes #140

Open
drhenner opened this issue Dec 9, 2011 · 0 comments
Open

namespacing model attributes #140

drhenner opened this issue Dec 9, 2011 · 0 comments

Comments

@drhenner
Copy link

drhenner commented Dec 9, 2011

When I create a namespace using nifty:scaffold without arguments, the only attribute is :name (even if "name" isn't an attribute)

I'd make a pull request for this but I have forked nifty-generators, quite a bit and I don't really know if it's possible to have 2 forks of the same repo. Either way the fix is pretty easy.

go into lib/generators/nifty/scaffold/scaffold_generator.rb (line 296)

Change to this:

  def model_exists?
         File.exist?( destination_path("app/models/#{singular_name}.rb")) || File.exist?( destination_path("app/models/#{instance_name}.rb"))
  end

I think people rarely namespace the models so you might not need:

File.exist?( destination_path("app/models/#{singular_name}.rb"))

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

No branches or pull requests

1 participant