sequenceable 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +10 -1
- data/lib/sequenceable/core.rb +1 -2
- data/lib/sequenceable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ac6fb7cbe7d47efc0c969a58a34a9c1141753dc94f5e230443d806f5db6212e
|
4
|
+
data.tar.gz: 14ce197c4708777135a3e1b01730547a0f8535eb34566795100d379a18c6a8e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36d603044b0f2cb188710692b5ea6fa277bb8041779ffa23a8b95d87322a6603b44963effeb34ab1c20d503b0c206ef4258b481d73f18ae62df632b1b777176b
|
7
|
+
data.tar.gz: c0a63afad9167f8b73fe8d93a16700b8a99016bbe1aa102b0e40f1a9c3e6dc09e7911bb9f94523121ea7919f89ffa77baf97ad6c46f8d66d8004476a9d7b3ce3
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Sequenceable
|
2
2
|
|
3
|
-
[](https://badge.fury.io/rb/sequenceable)
|
4
|
+
[](https://app.circleci.com/pipelines/github/sandip-mane/sequenceable?branch=master)
|
4
5
|
|
5
6
|
Adds sequencing abilities to the ActiveRecord Models.
|
6
7
|
This gem can be useful in managing `sequence` of the records in the database.
|
@@ -50,6 +51,14 @@ class Task < ActiveRecord::Base
|
|
50
51
|
end
|
51
52
|
```
|
52
53
|
|
54
|
+
You can scope on any column ( Yeah, thats right! )
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
class Task < ActiveRecord::Base
|
58
|
+
acts_in_sequence scope :name
|
59
|
+
end
|
60
|
+
```
|
61
|
+
|
53
62
|
#### :column_name
|
54
63
|
With `:column_name` we can use custom column names instead of using `sequence`.
|
55
64
|
|
data/lib/sequenceable/core.rb
CHANGED
@@ -15,8 +15,7 @@ module Sequenceable
|
|
15
15
|
for_name = sequencing_configuration[:scope]
|
16
16
|
return self.class if for_name.blank?
|
17
17
|
|
18
|
-
|
19
|
-
self.class.where(for_assoc.foreign_key => self[for_assoc.foreign_key])
|
18
|
+
self.class.where(for_name => self.send(for_name))
|
20
19
|
end
|
21
20
|
end
|
22
21
|
end
|
data/lib/sequenceable/version.rb
CHANGED