Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
acts_as_pasting
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
acts_as_pasting
Commits
6402d2ab
Commit
6402d2ab
authored
May 10, 2020
by
liyijie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pasting_type to migration & fix acts_as_pasting spell error
parent
71c53bb3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
1_create_acts_as_pasting_pastings.rb
db/migrate/1_create_acts_as_pasting_pastings.rb
+1
-0
pasted.rb
lib/acts_as_pasting/pasted.rb
+1
-1
No files found.
db/migrate/1_create_acts_as_pasting_pastings.rb
View file @
6402d2ab
...
...
@@ -4,6 +4,7 @@ class CreateActsAsPastingPastings < ActiveRecord::Migration[5.2]
t
.
references
:pasteable
,
polymorphic:
true
,
index:
{
name:
'acts_as_pasting_pasteable'
}
t
.
references
:pasted
,
polymorphic:
true
,
index:
{
name:
'acts_as_pasting_pasted'
}
t
.
string
:type
,
index:
true
t
.
string
:pasting_type
t
.
timestamps
end
...
...
lib/acts_as_pasting/pasted.rb
View file @
6402d2ab
...
...
@@ -9,7 +9,7 @@ module ActsAsPasting
scope
:pasted_with_any
,
->
(
ary
)
{
ary
=
parsed_condition_ary
(
ary
)
ary
.
map
{
|
klass
,
id
|
joins
(
:pastings
).
where
(
'acts_as_pasting
s_pastings.pasteable_type = ? AND acts_as_pastings
_pastings.pasteable_id = ?'
,
'acts_as_pasting
_pastings.pasteable_type = ? AND acts_as_pasting
_pastings.pasteable_id = ?'
,
klass
.
constantize
.
base_class
.
name
,
id
)
}.
reduce
(
:or
)
&
.
distinct
||
self
.
none
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment