Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 19 2018 23:23
    kiddrew commented #14160
  • Nov 19 2018 23:23
    gmcgibbon synchronize #34468
  • Nov 19 2018 23:23
    kiddrew commented #14160
  • Nov 19 2018 23:12
    kamipo commented #34316
  • Nov 19 2018 23:10
    oniofchaos commented #34218
  • Nov 19 2018 23:09
    rafaelfranca synchronize #30320
  • Nov 19 2018 23:08
    oniofchaos commented #34236
  • Nov 19 2018 23:07
    rafaelfranca closed #34487
  • Nov 19 2018 23:07

    rafaelfranca on master

    Prevent TextHelper#word_wrap fr… Merge pull request #34488 from … (compare)

  • Nov 19 2018 23:07
    rafaelfranca closed #34488
  • Nov 19 2018 23:06
    rafaelfranca review_requested #34308
  • Nov 19 2018 23:05
    oniofchaos commented #34280
  • Nov 19 2018 23:01
    oniofchaos commented #34308
  • Nov 19 2018 22:52
    rafaelfranca synchronize #30320
  • Nov 19 2018 22:51

    rafaelfranca on master

    Indent guides as rails help com… Homogenize rails help output I… Merge pull request #34085 from … (compare)

  • Nov 19 2018 22:51
    rafaelfranca closed #34085
  • Nov 19 2018 22:51
    rafaelfranca commented #33643
  • Nov 19 2018 22:51
    rafaelfranca closed #33643
  • Nov 19 2018 22:50

    rafaelfranca on 5-2-stable

    Merge pull request #34106 from … (compare)

  • Nov 19 2018 22:49
    rafaelfranca synchronize #30320
Fintan Moloney
@Josebuendia
Why did I get this: you can't redefine the primary key column 'id'. To define a custom primary key, pass { id: false } to create_table.
?
Kaia Leahy
@tenebrousedge
you're trying to redefine the id column
don't do that
Fintan Moloney
@Josebuendia
It was redefined with these commands?
rails generate scaffold Customer id:integer name:string phone:integer
rails generate scaffold Cases id:integer topic:string created_at:datetime
Kaia Leahy
@tenebrousedge
you can skip id:integer
Fintan Moloney
@Josebuendia
rails generate scaffold Customer id:integer name:string phone:integer
rails generate scaffold Cases topic:string created_at:datetime
Like so?
Kaia Leahy
@tenebrousedge
try it
Fintan Moloney
@Josebuendia
Delete the folders that have been created or will they be overriden?
Kaia Leahy
@tenebrousedge
rails will be clear about what it wants to do
Fintan Moloney
@Josebuendia
Okay, so I won't delete.
vocstartsoft:~/environment/retailApp (master) $ rails generate scaffold Customer id:integer name:string phone:integer
Running via Spring preloader in process 4791
invoke active_record
The name 'Customer' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative or use --force to skip this check and run this generator again.
vocstartsoft:~/environment/retailApp (master) $ rails generate scaffold Cases topic:string created_at:datetime
Running via Spring preloader in process 4806
[WARNING] The model name 'Cases' was recognized as a plural, using the singular 'Case' instead. Override with --force-plural or setup custom inflection rules for this noun before running the generator.
invoke active_record
The name 'Case' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative or use --force to skip this check and run this generator again.
vocstartsoft:~/environment/retailApp (master) $
Doesn't work.
Kaia Leahy
@tenebrousedge
you still have id:integer in your command
also, read the error messages
Fintan Moloney
@Josebuendia
But I need it in one of them don't I? How else can I put an id in the table?
Kaia Leahy
@tenebrousedge
it should generate an id column automatically
which is what the previous error message was telling you
Fintan Moloney
@Josebuendia
Oh, right. Now unless I delete the previous scaffold it will just repeat this: The name 'Case' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative or use --force to skip this check and run this generator again.
Kaia Leahy
@tenebrousedge
or you could use --force like it suggests
Fintan Moloney
@Josebuendia
Is it difficult to delete scaffold? If I force it I end up with 2 case folders and 2 customer folders.
Less folders better, no?
Kaia Leahy
@tenebrousedge
use rm -rf ./path/to/folder
Fintan Moloney
@Josebuendia
That did nothing.
Kaia Leahy
@tenebrousedge
then you didn't do it right
also it produces no output
so you should double check
Fintan Moloney
@Josebuendia
What am I looking for if it outputs nothing?
Kaia Leahy
@tenebrousedge
the folder in question won't be there any more
Fintan Moloney
@Josebuendia
They're there
image.png
Fintan Moloney
@Josebuendia
Got rid of them using: rails destroy scaffold Story
Daniel
@DanL12186
you replaced /path/to/folder with the respect file/path names, right...
Fintan Moloney
@Josebuendia
rails generate scaffold Customer name:string phone:integer
rails generate scaffold Cases topic:string created_at:datetime
So now I just enter the above commands, should work.

create_table(:cases)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

you can't define an already defined column 'created_at'.

So, didn't work, looked fine.
Kaia Leahy
@tenebrousedge
okay
so it's telling you that you already created those tables
Daniel
@DanL12186
It would have taken less effort to read and correct the error from the error message than it was to copy and paste and wait for someone to do it for you.
Kaia Leahy
@tenebrousedge
maybe you should tell rails to skip that step when it's generating the scaffold
Fintan Moloney
@Josebuendia
@DanL12186 But it made no sense I deleted the scaffolds, if I deleted the scaffolds the tables shouldn't be there.
Kaia Leahy
@tenebrousedge
what makes you think that?
I mean, clearly that's a wrong assumption
Daniel
@DanL12186
(Given it didn't work)
And no, scaffolds aren't tied to the existence of created tables
Fintan Moloney
@Josebuendia
Well then at what point did I create the tables?
Daniel
@DanL12186
migrate
Kaia Leahy
@tenebrousedge
and previously, whenever you defined migrations
Fintan Moloney
@Josebuendia
So, it wouldn't let me run migrations because of that prexisting table but I need to run migrations to run the server.