further 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +58 -3
- data/lib/further/version.rb +1 -1
- data/test/dummy/log/development.log +3 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b39a37789c4b6b16cf39285e6a856eda2863046
|
4
|
+
data.tar.gz: 535aa63ea6fcfe1f55a2d645439b453c9ab75521
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd4c56f2b5957658c6027f67f07e8d0dc5accb70e9886980acf8c7cc0329d2e0a240f04e4b81db3ae24ecdc30c396b03144516366d8eda68d9dcbcf038d0a362
|
7
|
+
data.tar.gz: 67d2df2f64b8ee989a363b4ff4aac993047d4a23644fee9cd214c52f84f3ee143c011dd830f2a05c52fee4969dae2a71760a013a0450c42b637400d2457c26ee
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,59 @@
|
|
1
|
-
further
|
2
|
-
|
1
|
+
# further [![Gem Version](https://badge.fury.io/rb/further.png)](http://badge.fury.io/rb/further)
|
2
|
+
|
3
|
+
This gem provides a simple and extremely flexible way to add extra data into your models
|
4
|
+
without adding new column for that.
|
5
|
+
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Install the latest stable release:
|
10
|
+
|
11
|
+
[sudo] gem install further
|
12
|
+
|
13
|
+
In Rails, add it to your Gemfile:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'further'
|
17
|
+
```
|
18
|
+
|
19
|
+
Finally, restart the server to apply the changes.
|
20
|
+
|
21
|
+
Note that further is work in Rails 3+ and Ruby 1.9+
|
22
|
+
|
23
|
+
## Getting Started
|
24
|
+
|
25
|
+
Start off by generating an uploader:
|
26
|
+
|
27
|
+
rails generate further model
|
28
|
+
|
29
|
+
This should give you further_information model and the migrate file.
|
30
|
+
|
31
|
+
app/models/further_information.rb
|
32
|
+
db/migrates/%timestamp%_create_further_information.rb
|
33
|
+
|
34
|
+
|
35
|
+
Then rake db:migrate
|
36
|
+
|
37
|
+
rake db:migrate
|
38
|
+
|
39
|
+
Open your model file that you want to use further with:
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
class Site < ActiveRecord::Base
|
43
|
+
# you can choose any name
|
44
|
+
further :info
|
45
|
+
end
|
46
|
+
```
|
47
|
+
|
48
|
+
Now you can add extra data in site model
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
s = Site.create info: {alexa_rank: 41253, last_updated: DateTime.now}
|
52
|
+
s.info[:alexa_rank] # => 41253
|
53
|
+
# you can add more info after you create the object
|
54
|
+
s.info page_rank: 3
|
55
|
+
s.info[:page_rank] # => 3
|
56
|
+
s.info # => {:alexa_rank=>41253, :last_updated=>Mon, 25 Nov 2013 18:43:22 +0300, :page_rank=>3}
|
57
|
+
```
|
58
|
+
|
3
59
|
|
4
|
-
Add more data in you model without adding a column in your table.
|
data/lib/further/version.rb
CHANGED
@@ -308,3 +308,6 @@ Connecting to database specified by database.yml
|
|
308
308
|
Connecting to database specified by database.yml
|
309
309
|
Connecting to database specified by database.yml
|
310
310
|
Connecting to database specified by database.yml
|
311
|
+
Connecting to database specified by database.yml
|
312
|
+
Connecting to database specified by database.yml
|
313
|
+
Connecting to database specified by database.yml
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: further
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdulaziz AlShetwi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -38,7 +38,8 @@ dependencies:
|
|
38
38
|
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
description:
|
41
|
+
description: This gem provides a simple and extremely flexible way to add extra data
|
42
|
+
into your models without adding new column for that.
|
42
43
|
email:
|
43
44
|
- ecleeld@gmail.com
|
44
45
|
executables: []
|
@@ -105,7 +106,8 @@ files:
|
|
105
106
|
- test/further_test.rb
|
106
107
|
- test/test_helper.rb
|
107
108
|
homepage: https://github.com/ecleel/further
|
108
|
-
licenses:
|
109
|
+
licenses:
|
110
|
+
- MIT
|
109
111
|
metadata: {}
|
110
112
|
post_install_message:
|
111
113
|
rdoc_options: []
|