social_stream 0.29.0 → 0.30.0
Sign up to get free protection for your applications and to get access to all the features.
- data/base/app/models/like.rb +8 -3
- data/base/config/locales/en.yml +1 -0
- data/base/config/locales/es.yml +1 -0
- data/base/db/migrate/{20120111141717_create_social_stream.rb → 20120326083509_create_social_stream.rb} +33 -8
- data/base/lib/generators/social_stream/base/install_generator.rb +1 -1
- data/base/lib/social_stream/base/version.rb +1 -1
- data/base/lib/social_stream/controllers/objects.rb +4 -2
- data/base/lib/tasks/attachments.rake +22 -0
- data/base/social_stream-base.gemspec +4 -4
- data/base/spec/controllers/relation_customs_controller_spec.rb +2 -1
- data/base/spec/dummy/config/initializers/devise.rb +5 -11
- data/documents/app/controllers/documents_controller.rb +1 -0
- data/documents/app/models/audio.rb +3 -3
- data/documents/app/models/document.rb +1 -3
- data/documents/app/models/picture.rb +4 -7
- data/documents/app/models/video.rb +2 -9
- data/documents/app/views/videos/_video_show.html.erb +1 -1
- data/documents/db/migrate/{20120109155431_create_social_stream_documents.rb → 20120208143721_create_social_stream_documents.rb} +0 -2
- data/documents/lib/delayed_paperclip/social_stream-documents.rb +7 -12
- data/documents/lib/generators/social_stream/documents/install_generator.rb +4 -0
- data/documents/lib/generators/social_stream/documents/templates/initializer.rb +26 -0
- data/documents/lib/social_stream-documents.rb +29 -0
- data/documents/lib/social_stream/documents/dependencies.rb +0 -1
- data/documents/lib/social_stream/documents/version.rb +1 -1
- data/documents/social_stream-documents.gemspec +4 -4
- data/documents/spec/dummy/config/initializers/devise.rb +4 -4
- data/events/db/migrate/20120330131859_create_social_stream_events.rb +29 -6
- data/events/lib/social_stream/events/version.rb +1 -1
- data/events/social_stream-events.gemspec +1 -1
- data/lib/social_stream/version.rb +1 -1
- data/linkser/app/controllers/links_controller.rb +8 -0
- data/linkser/db/migrate/{20111219122952_create_social_stream_linkser.rb → 20120208143739_create_social_stream_linkser.rb} +2 -2
- data/linkser/lib/social_stream/linkser/version.rb +1 -1
- data/linkser/social_stream-linkser.gemspec +1 -1
- data/linkser/spec/dummy/config/initializers/devise.rb +5 -9
- data/ostatus/app/decorators/social_stream/base/contact_decorator.rb +3 -0
- data/ostatus/lib/social_stream-ostatus.rb +1 -0
- data/ostatus/lib/social_stream/ostatus/activity_streams.rb +4 -2
- data/ostatus/lib/social_stream/ostatus/models/contact.rb +64 -0
- data/ostatus/lib/social_stream/ostatus/models/tie.rb +9 -8
- data/ostatus/lib/social_stream/ostatus/version.rb +1 -1
- data/ostatus/social_stream-ostatus.gemspec +2 -2
- data/presence/db/migrate/20120330132148_create_social_stream_presence.rb +6 -7
- data/presence/lib/social_stream/presence/version.rb +1 -1
- data/presence/social_stream-presence.gemspec +1 -1
- data/social_stream.gemspec +6 -6
- data/spec/dummy/config/database.yml +2 -0
- data/spec/dummy/config/initializers/devise.rb +4 -8
- metadata +22 -33
- data/base/db/migrate/20120201185454_singleton_single_relations.rb +0 -46
- data/base/db/migrate/20120208135718_group_title_and_description_in_activity_object.rb +0 -54
- data/base/db/migrate/20120302215722_activity_object_properties.rb +0 -24
- data/base/db/migrate/20120316093946_create_activity_actions.rb +0 -15
- data/base/db/migrate/20120316113728_activity_action_follow.rb +0 -23
- data/base/db/migrate/20120326083509_object_channels_to_actions.rb +0 -47
- data/documents/db/migrate/20120208143721_documents_group_title_and_description_in_activity_object.rb +0 -28
- data/documents/lib/paperclip/social_stream-documents.rb +0 -62
- data/events/db/migrate/20111218203314_create_events.rb +0 -33
- data/events/db/migrate/20120208143756_events_group_title_and_description_in_activity_object.rb +0 -26
- data/events/db/migrate/20120208144948_add_events_foreign_key.rb +0 -9
- data/linkser/db/migrate/20120202104549_add_links_foreign_key.rb +0 -9
- data/linkser/db/migrate/20120208143739_linkser_group_title_and_description_in_activity_object.rb +0 -30
- data/presence/db/migrate/20110711111408_add_connected_column_to_user.rb +0 -9
- data/presence/db/migrate/20110928135031_add_status_column_to_user.rb +0 -9
- data/presence/db/migrate/20111116194112_add_chat_enabled_column_to_user.rb +0 -9
data/documents/db/migrate/20120208143721_documents_group_title_and_description_in_activity_object.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
class DocumentsGroupTitleAndDescriptionInActivityObject < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
ao_ts = ActivityObject.record_timestamps
|
4
|
-
ActivityObject.record_timestamps = false
|
5
|
-
|
6
|
-
# Fix 'documents' table
|
7
|
-
d_ts = Document.record_timestamps
|
8
|
-
Document.record_timestamps = false
|
9
|
-
|
10
|
-
Document.all.each do |d|
|
11
|
-
d.activity_object.title = d.read_attribute(:title)
|
12
|
-
d.activity_object.description = d.read_attribute(:description)
|
13
|
-
d.save!
|
14
|
-
end
|
15
|
-
change_table :documents do |t|
|
16
|
-
t.remove :title
|
17
|
-
t.remove :description
|
18
|
-
end
|
19
|
-
Document.reset_column_information
|
20
|
-
Document.record_timestamps = d_ts
|
21
|
-
|
22
|
-
ActivityObject.record_timestamps = ao_ts
|
23
|
-
end
|
24
|
-
|
25
|
-
def down
|
26
|
-
raise ActiveRecord::IrreversibleMigration # Due to trans-gem oddities
|
27
|
-
end
|
28
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
# Monkey patch https://github.com/thoughtbot/paperclip/issues/293#issuecomment-2484541
|
2
|
-
# Monkey patch https://github.com/thoughtbot/paperclip/commit/2583a27df497e72ec7a200b6aa707948e88fd166
|
3
|
-
#
|
4
|
-
# Remove with paperclip > 2.5.0
|
5
|
-
require 'paperclip'
|
6
|
-
|
7
|
-
module Paperclip::ClassMethods
|
8
|
-
def has_attached_file name, options = {}
|
9
|
-
include Paperclip::InstanceMethods
|
10
|
-
|
11
|
-
if attachment_definitions.nil?
|
12
|
-
if respond_to?(:class_attribute)
|
13
|
-
self.attachment_definitions = {}
|
14
|
-
else
|
15
|
-
write_inheritable_attribute(:attachment_definitions, {})
|
16
|
-
end
|
17
|
-
else
|
18
|
-
self.attachment_definitions = self.attachment_definitions.dup
|
19
|
-
end
|
20
|
-
|
21
|
-
attachment_definitions[name] = {:validations => []}.merge(options)
|
22
|
-
Paperclip.classes_with_attachments << self.name
|
23
|
-
Paperclip.check_for_url_clash(name,attachment_definitions[name][:url],self.name)
|
24
|
-
|
25
|
-
after_save :save_attached_files
|
26
|
-
before_destroy :prepare_for_destroy
|
27
|
-
after_destroy :destroy_attached_files
|
28
|
-
|
29
|
-
define_paperclip_callbacks :post_process, :"#{name}_post_process"
|
30
|
-
|
31
|
-
define_method name do |*args|
|
32
|
-
a = attachment_for(name)
|
33
|
-
(args.length > 0) ? a.to_s(args.first) : a
|
34
|
-
end
|
35
|
-
|
36
|
-
define_method "#{name}=" do |file|
|
37
|
-
attachment_for(name).assign(file)
|
38
|
-
end
|
39
|
-
|
40
|
-
define_method "#{name}?" do
|
41
|
-
attachment_for(name).file?
|
42
|
-
end
|
43
|
-
|
44
|
-
validates_each(name) do |record, attr, value|
|
45
|
-
attachment = record.attachment_for(name)
|
46
|
-
attachment.send(:flush_errors)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def validates_attachment_presence name, options = {}
|
51
|
-
message = options[:message] || :empty
|
52
|
-
validates_each :"#{name}_file_name" do |record, attr, value|
|
53
|
-
if_clause_passed = options[:if].nil? || (options[:if].respond_to?(:call) ? options[:if].call(record) != false : record.send(options[:if]))
|
54
|
-
unless_clause_passed = options[:unless].nil? || (options[:unless].respond_to?(:call) ? !!options[:unless].call(record) == false : !record.send(options[:unless]))
|
55
|
-
|
56
|
-
if if_clause_passed && unless_clause_passed && value.blank?
|
57
|
-
record.errors.add(name, message)
|
58
|
-
record.errors.add("#{name}_file_name", message)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
class CreateEvents < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table "events", :force => true do |t|
|
4
|
-
t.integer "activity_object_id"
|
5
|
-
t.string "title"
|
6
|
-
t.datetime "start_at"
|
7
|
-
t.datetime "end_at"
|
8
|
-
t.boolean "all_day"
|
9
|
-
t.datetime "created_at", :null => false
|
10
|
-
t.datetime "updated_at", :null => false
|
11
|
-
t.integer "room_id"
|
12
|
-
t.date "start_date"
|
13
|
-
t.date "end_date"
|
14
|
-
t.integer "frequency", :default => 0
|
15
|
-
t.integer "interval"
|
16
|
-
t.integer "days", :default => 0
|
17
|
-
t.integer "interval_flag", :default => 0
|
18
|
-
end
|
19
|
-
|
20
|
-
add_index "events", ["room_id"], :name => "index_events_on_room_id"
|
21
|
-
|
22
|
-
create_table "rooms", :force => true do |t|
|
23
|
-
t.integer "actor_id"
|
24
|
-
t.string "name"
|
25
|
-
t.datetime "created_at", :null => false
|
26
|
-
t.datetime "updated_at", :null => false
|
27
|
-
end
|
28
|
-
|
29
|
-
add_index "rooms", ["actor_id"], :name => "index_rooms_on_actor_id"
|
30
|
-
|
31
|
-
add_foreign_key "events", "rooms", :name => "index_events_on_room_id"
|
32
|
-
end
|
33
|
-
end
|
data/events/db/migrate/20120208143756_events_group_title_and_description_in_activity_object.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
class EventsGroupTitleAndDescriptionInActivityObject < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
ao_ts = ActivityObject.record_timestamps
|
4
|
-
ActivityObject.record_timestamps = false
|
5
|
-
|
6
|
-
# Fix 'events' table
|
7
|
-
e_ts = Event.record_timestamps
|
8
|
-
Event.record_timestamps = false
|
9
|
-
|
10
|
-
Event.all.each do |e|
|
11
|
-
e.activity_object.title = e.read_attribute(:title)
|
12
|
-
e.save!
|
13
|
-
end
|
14
|
-
change_table :events do |t|
|
15
|
-
t.remove :title
|
16
|
-
end
|
17
|
-
Event.reset_column_information
|
18
|
-
Event.record_timestamps = e_ts
|
19
|
-
|
20
|
-
ActivityObject.record_timestamps = ao_ts
|
21
|
-
end
|
22
|
-
|
23
|
-
def down
|
24
|
-
raise ActiveRecord::IrreversibleMigration # Due to trans-gem oddities
|
25
|
-
end
|
26
|
-
end
|
data/linkser/db/migrate/20120208143739_linkser_group_title_and_description_in_activity_object.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
class LinkserGroupTitleAndDescriptionInActivityObject < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
ao_ts = ActivityObject.record_timestamps
|
4
|
-
ActivityObject.record_timestamps = false
|
5
|
-
|
6
|
-
# Fix 'links' table
|
7
|
-
l_ts = Link.record_timestamps
|
8
|
-
Link.record_timestamps = false
|
9
|
-
|
10
|
-
Link.all.each do |l|
|
11
|
-
l.activity_object.title = l.read_attribute(:title)
|
12
|
-
l.activity_object.description = l.read_attribute(:description)
|
13
|
-
l.save!
|
14
|
-
end
|
15
|
-
|
16
|
-
change_table :links do |t|
|
17
|
-
t.remove :title
|
18
|
-
t.remove :description
|
19
|
-
end
|
20
|
-
|
21
|
-
Link.reset_column_information
|
22
|
-
Link.record_timestamps = l_ts
|
23
|
-
|
24
|
-
ActivityObject.record_timestamps = ao_ts
|
25
|
-
end
|
26
|
-
|
27
|
-
def down
|
28
|
-
raise ActiveRecord::IrreversibleMigration # Due to trans-gem oddities
|
29
|
-
end
|
30
|
-
end
|