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

Deletion of moderatable objects #1

Merged
merged 1 commit into from Feb 5, 2016
Merged

Conversation

gecche
Copy link
Contributor

@gecche gecche commented Feb 5, 2016

Hi,

I think that there is a little when trying to delete a moderatable object by ising the delete() method. Indeed the eloquent delete method applies again the query scopes, so it is impossible to perform the delete on "rejected" adn "pending" objects.
I simply redefined the performDeleteOnModel in teh emoderatable class. Possibly there is a more elegant solution.

@hootlex hootlex merged commit d4b71cd into hootlex:master Feb 5, 2016
@hootlex
Copy link
Owner

hootlex commented Feb 5, 2016

I added a test for deletes (15099a3) and as it seems your solution works great.

Thanks @gecche!

@gecche
Copy link
Contributor Author

gecche commented Feb 5, 2016

i'm glad i was able
to help!
however, nice package! :)

giacomo

Inviato da iPhone

Il giorno 05 feb 2016, alle ore 21:18, Alex Kyriakidis notifications@github.com ha scritto:

I added a test for deletes (15099a3) and as it seems your solution works great.

Thanks @gecche!


Reply to this email directly or view it on GitHub.

@gecche
Copy link
Contributor Author

gecche commented Feb 6, 2016

Hi,

I've just done an extended search on the performDeleteOnModel in the Eloquent class.
Indeed the problem was not in your package but in the Laravel core 5.0 framework (the version I currently use on my project). Exactly the same "patch" to such method has been applied to laravel 5.1 and 5.2.

@hootlex
Copy link
Owner

hootlex commented Feb 7, 2016

Good to know that the package is compatible with Laravel 5.0!

@hootlex
Copy link
Owner

hootlex commented Mar 5, 2016

Hey @gecche , I am considering deleting performDeleteOnModel function since it has conflicts with SoftDeletes trait (#5). Will that cause any problems with your setup?

@gecche
Copy link
Contributor Author

gecche commented Mar 5, 2016

Hi,

No it's ok to remove that method because it is a bug of laravel 5.0 and not a bug of your module. It has been fixed since laravel 5.1 as I said to you in my last message.

Anyway, thank you for warning me about your change

Giacomo

Inviato da iPad

Il giorno 05 mar 2016, alle ore 22:42, Alex Kyriakidis notifications@github.com ha scritto:

Hey @gecche , I am considering deleting performDeleteOnModel function since it has conflicts with SoftDeletes trait (#5). Will that cause any problems with your setup?


Reply to this email directly or view it on GitHub.

@hootlex
Copy link
Owner

hootlex commented Mar 5, 2016

No problem. Can you think another workaround to achieve compatibility with Laravel 5.0?
Which version of Laravel do you use now?

@gecche
Copy link
Contributor Author

gecche commented Mar 5, 2016

Mmmh, I think the only way is to keep two distinct versions of the module, but I don't know if the softdeletes trait problem applies to 5.0 too.

For me is not a problem because I fixed the bug in my projects directly and also I plan to move as soon as possible to 5.2

Giacomo

Inviato da iPad

Il giorno 05 mar 2016, alle ore 22:53, Alex Kyriakidis notifications@github.com ha scritto:

No problem. Can you think another workaround to achieve compatibility with Laravel 5.0?
Which version of Laravel do you use now?


Reply to this email directly or view it on GitHub.

@hootlex
Copy link
Owner

hootlex commented Mar 5, 2016

Okay then I will remove the function entirely.

Thanks

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

Successfully merging this pull request may close these issues.

None yet

2 participants