Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: sailing/diaspora
...
head fork: sailing/diaspora
  • 4 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jan 23, 2012
Federico Ramallo + Galen Sanford fixed js error after merge 6f3cfc9
Federico Ramallo + Galen Sanford added uniqueness validations c4cc8dd
Federico Ramallo + Galen Sanford improved places diaspora_handle to include the host c243b93
Federico Ramallo + Galen Sanford listing posts for a place 4239fa2
View
7 app/models/place.rb
@@ -8,9 +8,14 @@ class Place < ActiveRecord::Base
accepts_nested_attributes_for :description
validates_presence_of :description
+ validates :diaspora_handle, :uniqueness => true
before_save :auto_diaspora_handle
+ has_one :place_mention
+ has_many :posts, :through=> :place_mention
+
+
#attr_accessible
def initialize(attributes={})
@@ -19,7 +24,7 @@ def initialize(attributes={})
end
def auto_diaspora_handle
- self.diaspora_handle ||= description.title_sanitized
+ self.diaspora_handle ||= "#{description.title_sanitized}#{User.diaspora_id_host}"
end
end
View
2  lib/stream/place.rb
@@ -17,7 +17,7 @@ def place
# @return [ActiveRecord::Association<Post>] AR association of posts
def posts
- @posts ||= Post.all_public
+ @posts ||= place.posts
end
end
View
2  public/javascripts/app/router.js
@@ -10,8 +10,8 @@ app.Router = Backbone.Router.extend({
"followed_tags": "stream",
"tags/:name": "stream",
"posts/:id": "stream",
- "p/:id": "stream"
"places/:id": "stream",
+ "p/:id": "stream"
},
stream : function() {

No commit comments for this range

Something went wrong with that request. Please try again.