espresso 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/espresso.gemspec +1 -1
- data/lib/espresso/model.rb +3 -10
- metadata +1 -1
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.9
|
data/espresso.gemspec
CHANGED
data/lib/espresso/model.rb
CHANGED
@@ -5,11 +5,7 @@ module Espresso
|
|
5
5
|
module Model
|
6
6
|
def self.included(model)
|
7
7
|
model.extend ClassMethods
|
8
|
-
model.
|
9
|
-
include InstanceMethods
|
10
|
-
|
11
|
-
name_field(:name)
|
12
|
-
end
|
8
|
+
model.send :include, InstanceMethods
|
13
9
|
end
|
14
10
|
|
15
11
|
module ClassMethods
|
@@ -41,11 +37,8 @@ module Espresso
|
|
41
37
|
# «NameField» is a main field, used to represent model in to_s method and in simple queries
|
42
38
|
# @param [Symbol, String] new_name_field new field name
|
43
39
|
# @return [Symbol] field name
|
44
|
-
def name_field
|
45
|
-
|
46
|
-
@@name_field = new_name_field.to_sym
|
47
|
-
end
|
48
|
-
@@name_field
|
40
|
+
def name_field
|
41
|
+
:name
|
49
42
|
end
|
50
43
|
|
51
44
|
# Make a slug from object’s NameField
|