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

Leave Scope Added #271

Closed
wants to merge 3 commits into from
Closed

Leave Scope Added #271

wants to merge 3 commits into from

Conversation

ImDineshSaini
Copy link

Leave scope added and now the function can be used as ModelName.leaves

Leave scope added and now the function can be used as ModelName.leaves
@ImDineshSaini
Copy link
Author

Leave option added - dependent function added

@antstorm
Copy link
Contributor

antstorm commented Mar 8, 2016

@ImDineshSaini this PR is a total rip off of #246

@ImDineshSaini
Copy link
Author

Yes and one more changes required I have seen the Rails 4 is work with mysql2 gem so text_type = if ActiveRecord::Base.connection.adapter_name.downcase == 'mysql2' replaced by text_type = if ActiveRecord::Base.connection.adapter_name.downcase == 'mysql'

 this PR is a total rip off of #246 is improved as Gem thrown error if utf8 is not selected during casting and need mysql2 as connection name for rails 4
@ImDineshSaini
Copy link
Author

this PR is a total rip off of #246 + Fix the mysql connection error with rails 4 and utf issue.

@antstorm
Copy link
Contributor

antstorm commented Mar 8, 2016

@ImDineshSaini all of that is fixed in #246 and tested

@ImDineshSaini
Copy link
Author

I have tries with Rails 4.2.3 and mysql and it give me error and reason is that mysql2 is use as connection not mysql.

id_column_as_text = sql_cast_as_text(id_column)
parent_ancestry = sql_concat("#{table_name}.#{ancestry_column}", "'/'", id_column_as_text)

joins("LEFT JOIN #{table_name} AS c ON c.#{ancestry_column} = #{id_column_as_text} OR c.#{ancestry_column} = #{parent_ancestry}").
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way to use an existing scope here?
Only adding the group and having

Also, should id be primary_key?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better yet, is there a way to extract this concept so we can use it more?

'TEXT'
end
# updated mysql thrown error if utf is not defined
"CAST(#{column} AS #{text_type}) collate utf8_unicode_ci"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think the collate is better up with mysql only

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kbrock why are you even looking at this PR? The original one is #246

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please be nice

@kbrock
Copy link
Collaborator

kbrock commented Dec 18, 2018

Closing in favor of #246

@kbrock kbrock closed this Dec 18, 2018
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.

3 participants