drupal83 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -0
- data/lib/drupal/role.rb +7 -0
- data/lib/drupal/user.rb +22 -0
- data/lib/drupal/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -3,6 +3,10 @@ https://rubygems.org/gems/drupal83
|
|
3
3
|
|
4
4
|
Help you to migrate Drupal (php) to a Ruby web project ;)
|
5
5
|
|
6
|
+
WARNIG ::
|
7
|
+
for now you can use this gem only with a 6.1.* Drupal site.
|
8
|
+
we plan to manage Drupal 7 site in future version
|
9
|
+
|
6
10
|
## Dependencies
|
7
11
|
datamapper sources http://datamapper.org/
|
8
12
|
|
data/lib/drupal/role.rb
CHANGED
data/lib/drupal/user.rb
CHANGED
@@ -21,6 +21,12 @@ module Drupal
|
|
21
21
|
has n, :comments,
|
22
22
|
:child_key => [:uid],
|
23
23
|
:repository => Drupal::Repository
|
24
|
+
|
25
|
+
has n, :user_roles,
|
26
|
+
:child_key => [:uid],
|
27
|
+
:repository => Drupal::Repository
|
28
|
+
|
29
|
+
has n, :roles, :through => :user_roles
|
24
30
|
|
25
31
|
def profile
|
26
32
|
Drupal::Node.first :type => 'profile', :uid => uid
|
@@ -29,4 +35,20 @@ module Drupal
|
|
29
35
|
#property :created, Date
|
30
36
|
#def created_at ; Time.at(self[:created]) ; end
|
31
37
|
end
|
38
|
+
|
39
|
+
class UserRole
|
40
|
+
eval Drupal.common
|
41
|
+
storage_names[:drupal] = 'users_roles'
|
42
|
+
|
43
|
+
property :rid, Integer
|
44
|
+
property :uid, Integer
|
45
|
+
|
46
|
+
belongs_to :role,
|
47
|
+
:child_key => [:rid],
|
48
|
+
:repository => Drupal::Repository
|
49
|
+
|
50
|
+
belongs_to :user,
|
51
|
+
:child_key => [:uid],
|
52
|
+
:repository => Drupal::Repository
|
53
|
+
end
|
32
54
|
end
|
data/lib/drupal/version.rb
CHANGED